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 do you mean by reference counts, Q. If each the access rights to an o...

Q. If each the access rights to an object are deleted the object can no longer be accessed. At this stage the object should also be deleted and the space it occupies should be ret

What is virtual file system?, What is virtual file system? A Virtual f...

What is virtual file system? A Virtual file system switch (VFS) or Virtual file system is an abstraction layer   on top of a more concrete file system. The purpose of a VFS

Explain process scheduling in time sharing, Explain process scheduling in t...

Explain process scheduling in time sharing The relevant features of time sharing are: 1.      Process priorities do not depend on the nature of the processes 2.      Proc

Explain about error detection method, Q. Explain about Error detection meth...

Q. Explain about Error detection method? Error detection: error can occur in CPU, in I/O devices or in memory hardware. Operating system constantly needs to be aware of possi

What is a process, What is a process? A process is a program in impleme...

What is a process? A process is a program in implementation. It is an active entity and it contains the process stack, having temporary data and the data section includes globa

How is the NTFS namespace planned, Q. How is the NTFS namespace planned? Ex...

Q. How is the NTFS namespace planned? Explain. Answer: The NTFS namespace is prearranged as a hierarchy of directories where every directory uses a B+ tree data structure to

Beladys anomaly algorithm, Q.  You have devised a fresh page-replacement a...

Q.  You have devised a fresh page-replacement algorithm that you think may be optimal. In a few contorted test cases Belady's anomaly occurs. Is the fresh algorithm optimal? Descr

List five services provided by an operating system, List five services prov...

List five services provided by an operating system. Explain how each provides convenience to the users. Explain also in which cases it would be impossible for user-level programs t

Linux, write a linux command to display lines from 25 - 45 of directory "/e...

write a linux command to display lines from 25 - 45 of directory "/edc/password"

Illustrate the operating system components, Q. Illustrate the Operating Sys...

Q. Illustrate the Operating System Components? Modern operating systems share the goal of supporting system components. System components are: 1.  Process Management 2.

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