Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

22. Advanced Threading > Exclusive Locking

Exclusive Locking

There are three exclusive locking constructs: the lock statement, Mutex and SpinLock. The lock construct is the most convenient and widely used, whereas the other two target niche scenarios:

  • Mutex lets you span multiple processes (computer-wide locks).

  • SpinLock implements a micro-optimization that can lessen context switches in high-concurrency scenarios (see http://albahari.com/threading/).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


 Â