Monday, May 25, 2009

Exercise 17

Exercise 17: Concurrency Terms

1.Find definitions for eight terms and concepts used in threaded programming

 Waitable timer: Waitable timers were introduced with Windows 98 and Windows NT 4.0. and they were designed to work with threads that need to block for some times. A waitable timer object is a synchronization object whose state is set to signaled when the specified due time arrives. There are two types of waitable timers that can be created: manual-reset and synchronization.
 Mutex (mutual exclusion): Mutual exclusion 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.
 Thread Synchronization: Thread synchronization requires that a running thread gain a "lock" on an object before it can access it. The thread will wait in line for another thread that is using the method/data member to be done with it. This is very important to prevent the corruption of program data if multiple threads will be accessing the same data. (unanynomous)
 Semaphores: a semaphore 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 multiprogramming environment. A counting semaphore is a counter for a set of available resources, rather than a locked/unlocked flag of a single resource. (anynomous, Semaphore (programming))
 Locks:It is used to prevent conflict by ensuring that only one thread can access the resource at a time. It might be read or write lock.
 Deadlock: A deadlock is a situation where in two or more competing actions are waiting for the other to finish, and thus neither ever does. (anynomous, wipkipedia)


 Threads: A thread is a sequence of responses to an initial message posting. This enables you to follow or join an individual discussion in a newsgroup from among the many that may be there. A thread is usually shown graphically as an inital message and successive messages "hung off" the original message.
 Event:An event is a sensor output, user action, or a message from other programs or threads (Wikipedia – Event-driven programming, n.d.).

No comments:

Post a Comment