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

List ways to share directories in operating system, List ways to share file...

List ways to share files among directories in operating systems. a. Copy file from one account into another. b. Link directory entry of "copied" file to directory entry of o

What is external fragmentation?, What is external fragmentation? As pro...

What is external fragmentation? As process are removed from and loaded to the memory free memory space is bracken into pieces .external fragmentation take place when enough mem

What is the purpose of system programs, What is the purpose of system progr...

What is the purpose of system programs? System programs can be thought of as bundles of useful system calls. They give basic functionality to users and so users do not require

List three ways of allocating storage, List three ways of allocating storag...

List three ways of allocating storage, and give advantages of each. a. Contiguous allocation. Fastest, if no changes are to be made. Also simplest for random access files. b

Pages into physical memory, For reading, most operating systems use demand ...

For reading, most operating systems use demand paging. This means that pages are only read from the disk into physical memory when they are needed. In the page table, there is a re

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

What are the major differences between operating systems, Q. What are the m...

Q. What are the major differences between operating systems for mainframe computers and personal computers? Answer: In general operating systems for batch systems have simpler

What is an operating system?, What is an operating system? An operating...

What is an operating system? An operating system is a program that acts as a mediator between a user and the computer hardware. The function of an operating system is to provid

Interpreters, Use and overview? Pure and impure interpreter?

Use and overview? Pure and impure interpreter?

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