O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

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

Context

In order for us to understand how the runtime is able to enforce a threading requirement based on an attribute, we have to introduce the concept of context. Step 4 of the Threading example is the same code as Step 3, but with some additional output:

 Is the customer object a proxy? False Is the bookings object a proxy? True Added Boston Presidential Hotel with one room. Thread 111 ContextId 0 launching 3 threads. MakeReservation: Thread 126 ContextId 0 starting. MakeReservation: Thread 127 ContextId 0 starting. CancelReservation: Thread 128 ContextId 0 starting. Cancelling Reservation 10 Thread 128 ContextId 1 entered CancelReservation. Thread 128 ContextId 1 left CancelReservation. Reserving for Customer 2 ... on 12/13/2001 ... for 1 ...

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