Because of project, I read some materials about multithreading and synchronization.
The following list describes some of the methods implement thread-safe code.
1. lock
C# keyword. It can be used as an alternative to the methods of the Monitor class.
2.Monitor
Monitors object are used to lock the critical sections of code so that one and only one thread can
has access to those critical sections at any point of time.
3. Mutex
Similar to Monitor, it is used to ensure that only one thread can access resource that shared across process mostly.
4. SynchronizationAttribute
ensure that only one thread at a time can access an object.
5. MethodImplAttribute
notified the complier on how the method should be implemented.
I will give example and discuss the difference between these methods later.
-------------------------------------------------------------------------------------------
此文有特殊的目的:练习英语写作
posted on 2007-01-31 21:07
tablefor2 阅读(185)
评论(0) 编辑 收藏