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

What is direct memory access, Direct memory access Many computers avoid...

Direct memory access Many computers avoid burdening the main CPU with programmed I/O by offloading sine if this work to a special-purpose processor known as a direct memory add

Difference between two tier and three tier architectures, Question: a) ...

Question: a) Illustrate with the help of a diagram, the difference between two tier and three tier architectures. b) Explain in what kind of environment, a peer to peer envi

Explain short term scheduling, Short term scheduling The short term sch...

Short term scheduling The short term scheduler as well known as the dispatcher executes most frequently and makes the fine grained decision of which process to execute next. Th

Synchronization, What is the different between basic synchronization and hi...

What is the different between basic synchronization and high level synchronization

Explain the concept of reentrancy, Concept of Reentrancy   It is a ...

Concept of Reentrancy   It is a useful, memory-saving method for multiprogrammed timesharing machines. A Reentrant method is one in which multiple clients can share a singl

Explain the various methods of file access, Operating Systems 1. Illust...

Operating Systems 1. Illustrate the Microkernel Architecture with suitable diagram. 2. When Deadlock occurs? What are the Necessary Conditions for Deadlock? 3. Describe f

Fibonacci sequence, #questionThe Fibonacci sequence is the series of number...

#questionThe Fibonacci sequence is the series of numbers 0,1,1,2,3,5,8,… Formally, it can be expressed as: fib0 = 0 fib1 = 1 fibn = fib n-1 + fib n-2 Write a C program u

Recognition of essential syntactic constructs by reductions, Recognition of...

Recognition of essential syntactic constructs by reductions, this task is carried out by Recognition of essential syntactic constructs by reductions, this task is carried out

Operating System, my Operating System is windows trust but when the windows...

my Operating System is windows trust but when the windows start say its windows xp. help pleaes

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