Direct thread manipulation issues

  • 545
  • 0

Direct thread manipulation issues

deadlocks :
a situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does.[1]

livelocks :
similar to a deadlock, except that the states of the processes involved in the livelock constantly change with regard to one another, none progressing.It is a special case of resource starvation.[2]

resource starvation :
a problem encountered in multitasking where a process is perpetually denied necessary resources. Without those resources, the program can never finish its task.[3]

resource leak :
a particular type of resource consumption by a computer program where the program does not release resources it has acquired.Typical resource leaks include memory leak and handle leak[4]

memory leak :
a computer program incorrectly manages memory allocations.[5]

handle leak :
a computer program asks for a handle to a resource but does not free the handle when it is no longer used.[6]

lock convoys :
when multiple threads of equal priority contend repeatedly for the same lock. Unlike deadlock and livelock situations, the threads in a lock convoy do progress; however, each time a thread attempts to acquire the lock and fails, it relinquishes the remainder of its scheduling quantum and forces a context switch.[7]

context switch :
the process of storing and restoring the state (context) of a process or thread so that execution can be resumed from the same point at a later time.[8]

two-step dances :
Sometimes you need to signal an event while holding a lock. This can be unfortunate if the waking thread needs to acquire the lock held, because it will be awakened only to find out that it must wait again. This is wasteful and increases the number of overall context switches. This situation is called the two-step dance, and can extend far beyond just two steps if many locks and events are involved.[9]

race conditions :
an application depends on the sequence or timing of processes or threads for it to operate properly.[10]

oversubscription :
Overselling or overbooking is sale of a volatile good or service in excess of actual capacity. Overselling is a common practice in the travel and lodging industry. In telecommunications, sometimes the term oversubscription is preferred.[11]

 

資料來源:

[1]Deadlock
http://en.wikipedia.org/wiki/Deadlock

[2]Deadlock
http://en.wikipedia.org/wiki/Deadlock

[3]Resource starvation
http://en.wikipedia.org/wiki/Resource_starvation

[4]Resource leak
http://en.wikipedia.org/wiki/Resource_leak

[5]Memory leak
http://en.wikipedia.org/wiki/Memory_leak

[6]Handle leak
http://en.wikipedia.org/wiki/Handle_leak

[7]Lock convoy
http://en.wikipedia.org/wiki/Lock_convoy

[8]Context switch
http://en.wikipedia.org/wiki/Context_switch

[9]Solving 11 Likely Problems In Your Multithreaded Code
http://msdn.microsoft.com/en-us/magazine/cc817398.aspx

[10]Race condition
http://en.wikipedia.org/wiki/Race_condition#Software

[11]Oversubscription
http://en.wikipedia.org/wiki/Overselling

 

延伸閱讀:

[1]The Past, Present and Future of Parallelizing .NET Applications
http://msdn.microsoft.com/en-us/magazine/hh335070.aspx