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

Safety algorithm and resource request algorithm, Safety algorithm : This is...

Safety algorithm : This is to make sure if the system is in safe state or not. It may need an order of m x n2 operation to determine if the state of the system is safe or not.

Queing theory, how to solve queing theory step by step

how to solve queing theory step by step

Explain how a domain user account is authenticated, Question: a) The fo...

Question: a) The following questions pertain to User and Group accounts in Windows XP: i) Give four differences between a Power User and a Guest User account. ii) Explain h

Unix, what is difference between file descriptor and file pointer?

what is difference between file descriptor and file pointer?

Explain process description in the unix system, Process Description A pr...

Process Description A process in UNIX is a somewhat complex set of data structures that provides the operating system with all of the information necessary to dispatch and manag

Digital circuits and design , 1. Draw a schematic diagram of a CMOS inverte...

1. Draw a schematic diagram of a CMOS inverter and explain its operation. 2. Draw schematic diagrams of CMOS NAND and NOR gates, and explain their operation. 3. Explain what

Briefly explain about file system implementation, Briefly explain about fil...

Briefly explain about file system implementation? Several on-disk and in-memory structures are used to execute a file system. On disk, the file system may have information abou

Can you give me assistance on my operating system assignment, Can you give ...

Can you give me assistance on my operating system assignment?

Explain internal file structure, Internal file structure All disk I/O i...

Internal file structure All disk I/O is performed in units of single block, and all blocks are the similar size. It is unlikely that the physical record size will exactly match

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