Figure 12-2
This illustration describes context sharing among threads. An application spawns a thread to execute a query to a server. The application has the following syntax:
main program
ENABLE THREADS
ALLOCATE :ctx
USE :ctx
connect...
spawning threads
FREE :ctx
Threads are spawned and terminated as they execute a query. Their syntax is as follows:
T1
USE :ctx
mutex
select...
unmutex
T2
USE :ctx
mutex
update...
unmutex
Tn
USE :ctx
mutex
select...
unmutex