Sunday, 14 June 2009

Concurrency terms

Find definitions for eight terms and concepts used in threaded programming:


Thread Synchronisation - This is a popular terminology used in the programming languages such as .Net, Java, Python and ...It means the coordination of multiple threads that must access shared data in Java language (Venners 1997).

Locks - This can ensure that only one thread at a time is given access to a resource (Ince 2005 pp.341-342).

Deadlock - This occurs when there is a contention between two transactions for two items of data and would occur in all distributed systems where there is shared access; however, in those systems where there are a number of clients which hold data for a long time (the typical interactive system) it is a major occurrence (Ince 2005, p.351).

Semaphores - This is a protected variable or abstract data type which constitutes the classic method for restricting access to shared resources such as shared memory in a parallel programming environment. A counting semaphore is a counter for a set of available resources, rather than a locked/unlocked flag of a single resource (Wikipedia 2009).

Mutex (mutual exclusion) - Mutex algorithms are used in concurrent programming to avoid the simultaneous use of a common resource, such as a global variable, by pieces of computer code called critical sections. A critical section is a piece of code where a process or thread accesses a common resource. The critical section by itself is not a mechanism or algorithm for mutual exclusion. In other words, Mutex is a not default algorithm in a program which includes critical sections (Wikipedia 2009).


Thread - A thread is anexecution of a chunk of code which can be carried out in parallel with the execution ofother chunks of code. On a computer with a number of processors the threads can beexecuted concurrently, with each instruction of each thread being executed at the sametime (Ince 2005, p.336).

Event - This is an action or a request that is usually initiated outside the scope of a program and that is handled by a piece of code inside the program. Typically events are handled synchronous with the program flow, that is, the program has one or more dedicated places where events are handled. In the threaded programming environment, when one event holds up the thread, the other thread can make use of the processor that has been forced to be idle. For example, a request for some data from a computer resident on a wide area network suchas the Internet (Ince 2005, p.336).

Waitable timer - According to Microsoft Developer Network (2009), Waitable Timer is a synchronization object whose state is set to signaled when the specified due time arrives. The operations of threads are prioritised by the timer objects.


References

Ince, D 2004, Developing distributed and e-commerce applications, 2nd edn, Harlow, Essex, UK: Addison – Wesley, pp. 336-373.

Microsoft Developer Network 2009, Waitable Timer Objects, Library, viewed 15 June 2009, http://msdn.microsoft.com/en-us/library/ms687012(VS.85).aspx>.

Venners, B 1997, 'How the Java machine performs Thread Synchronization' , JAVAWORLD, posted 1 July, viewed 14 June 2009, <http://www.javaworld.com/javaworld/jw-07-1997/jw-07-hood.html>.

Wikipedia 2009, Semaphores (Programming), Wikipedia, The free encyclopedia, last modified 5 June 2009, Wikimedia Foundation, Inc., US, viewed 14 June 2009, <http://en.wikipedia.org/wiki/Semaphore_(programming)>.

Wikipedia 2009, Mutual exclusion, Wikipedia, The free encyclopedia, last modified 4 June 2009, Wikimedia Foundation, Inc., US, viewed 14 June 2009, <http://en.wikipedia.org/wiki/Mutual_exclusion>.

No comments: