O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Synchronizing Threads

There are many situations in which threads cannot run simultaneously and access the existing resources of an application. Remember synchronous access to lists: when thread A queries the Count property of a listing at the same time that thread B completes adding a new element, thread A reaches a state in which further processing is not correct. This is not supposed to happen; access to the methods and properties should be thread-safe and synchronized. In other words, you can query the count property, but once that query starts, other threads must wait until the query completes. The same logic applies for operations that modify the list: threads querying the Count property of a listing must wait until threads modifying the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required