Figure 11-3
This illustration describes no context sharing among threads. An application spawns multiple threads to execute a query to a server. The application has the following syntax:
main program
ENABLE THREADS
ALLOCATE :ctx1
ALLOCATE :ctx2
...
ALLOCATE :ctxn
...
spawning threads
...
FREE :ctx1
FREE :ctx2
...
FREE :ctxn
Threads are spawned and terminated as they execute a query. Their syntax is as follows:
T1
USE :ctx1
select...
T2
USE :ctx2
update...
Tn
USE :ctxn
select...