1. Thread Synchronisation
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. If two threads try to change a variable or execute the same method at the same, this can cause serious and difficult to find problems. Thread synchronization helps prevent this. (http://wiki.answers.com/Q/What_is_Thread_Synchronization )
2. Locks
To make a file or other piece of data inaccessible. File locking is a critical component of all multi-user computer systems, including local-area networks. When users share files, the operating system must ensure that two or more users do not attempt to modify the same file simultaneously. It does this by locking the file as soon as the first user opens it. All subsequent users may read the file, but they cannot write to it until the first user is finished. In addition to file locking, many database management systems support record locking, in which a single record, rather than an entire file, is locked. This enables different users to access different records within the same file without interfering with one another. (http://www.webopedia.com/TERM/L/lock.html )
3. Deadlock
A condition that occurs when two processes are each waiting for the other to complete before proceeding. The result is that both processes hang. Deadlocks occur most commonly in multitasking and client/server environments. Ideally, the programs that are deadlocked, or the operating system, should resolve the deadlock, but this doesn't always happen. A deadlock is also called a deadly embrace. (http://webopedia.com/TERM/D/deadlock.html )
4. Semaphores
A hardware or software flag. In multitasking systems, a semaphore is a variable with a value that indicates the status of a common resource. It's used to lock the resource that is being used. A process needing the resource checks the semaphore to determine the resource's status and then decides how to proceed. (http://webopedia.com/TERM/s/semaphore.html )
5.Mutex (mutual exclusion)
In computer programming, a mutex is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously. When a program is started, a mutex is created with a unique name. After this stage, any thread that needs the resource must lock the mutex from other threads while it is using the resource. The mutex is set to unlock when the data is no longer needed or the routine is finished. (http://webopedia.com/TERM/m/mutex.html )
6. Thread
In programming, a part of a program that can execute independently of other parts. Operating systems that support multithreading enable programmers to design programs whose threaded parts can execute concurrently. (http://webopedia.com/TERM/t/thread.html)
7. Event
An action or occurrence detected by a program. Events can be user actions, such as clicking a mouse button or pressing a key, or system occurrences, such as running out of memory. Most modern applications, particularly those that run in Macintosh and Windows environments, are said to be event-driven, because they are designed to respond to events.
(http://webopedia.com/TERM/e/event.html )
8. Waitable timer
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. A timer of either type can also be a periodic timer.
A thread uses the CreateWaitableTimer or CreateWaitableTimerEx function to create a timer object. The creating thread specifies whether the timer is a manual-reset timer or a synchronization timer. The creating thread can specify a name for the timer object. Threads in other processes can open a handle to an existing timer by specifying its name in a call to the OpenWaitableTimer function. Any thread with a handle to a timer object can use one of the wait functions to wait for the timer state to be set to signaled.
A thread can use the CancelWaitableTimer function to set the timer to the inactive state. To reset the timer, call SetWaitableTimer. When you are finished with the timer object, call CloseHandle to close the handle to the timer object.
(http://msdn.microsoft.com/en-us/library/ms687012(VS.85).aspx)
沒有留言:
發佈留言