June 2002
Intermediate to advanced
864 pages
18h 35m
English
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 ...
Read now
Unlock full access