Explain debugging a multi threaded program, Operating System

Assignment Help:

Debugging a multi threaded program

The following list points out few of the more frequent oversights and errors that can cause bugs in multithreaded programs.

1.    Ephemeral a pointer to the caller's stack as an argument to a new thread.

2.    Accessing global memory shared variable state without the protection of a synchronization mechanism.

3.    Creating deadlocks originated by two threads trying to acquire rights to the same pair of global resources in alternate order so that one thread controls the first resource and the other controls the second resource and neither can proceed until the other gives up.

4.     Trying to retain a lock already held (recursive deadlock).

5.   Creating a hidden gap within synchronization protection. This is originated when a code segment protected by a synchronization mechanism contains a call to a function that frees and then reacquires the synchronization mechanism before it returns to the caller. The result is that it emerge to the caller that the global data has been protected when it actually has not.

6.    Mixing UNIX signals with threads -- it is superior to use the sigwait() model for handling asynchronous signals.

7.  Making extremely nested, recursive calls as well as using large automatic arrays can cause problems because multithreaded programs have a more limited stack size than single-threaded programs.

8.   Identifying an inadequate stack size or using non-default stacks. And note that multithreaded programs particularly those containing bugs frequently behave differently in two successive runs, given identical inputs, for the reason that of differences in the thread scheduling order.

9.  Generally multithreading bugs are statistical instead of deterministic. Tracing is typically a more effective method of finding order of execution problems than is breakpoint-based debugging.

 


Related Discussions:- Explain debugging a multi threaded program

Can a direct access file be read sequentially, Can a direct access file be ...

Can a direct access file be read sequentially? Explain. Yes. Keep a counter, cp, initially set to 0. After reading record cp, increment cp.

What is dispatch latency, What is dispatch latency? The time taken by t...

What is dispatch latency? The time taken by the dispatcher to stop one process and begin another running is known as dispatch latency.

Describe the benefits of using microkernels, Question: (a) (i) What is ...

Question: (a) (i) What is a microkernel? Describe the benefits of using microkernels. (ii) How does a microkernel-based operating system differ from a traditional operating

What are kernels and what do kernels do, What are kernels and what do kerne...

What are kernels and what do kernels do? The kernel is a program that comprises the central core of a computer operating   system. It has entire control over everything that

Explain terminal symbols, Explain Terminal Symbols Terminal symbols are...

Explain Terminal Symbols Terminal symbols are literal strings that are forming the input of a formal grammar and cannot be broken down into smaller units with no losing their l

Define an assembly language, Define an assembly language  Assembly lan...

Define an assembly language  Assembly language stands for a Low level programming language

Explain the exit (status) function, Explain the Exit (status) Function  ...

Explain the Exit (status) Function  Exit function causes the calling process to be terminated. Actually, all file descriptors are immediately closed but the process is   not

integrator circuit, Referring to Figure below, discuss how you would alter...

Referring to Figure below, discuss how you would alter the circuit to obtain: 1. a straightforward amplifier with gain 1, 2. a straightforward amplifier with gain 10, 3. a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd