Threads Module User's Guide : PART II Concurrency Packages : Chapter 3 The Threading Package : The Server Classes : Interrupting a Server
Interrupting a Server
An RWRunnableServer services an interrupt request immediately after dequeuing a runnable but before executing it.
An RWServerPool can service an interrupt request at two points:
After dequeuing a runnable and before dequeuing the next available runnable server.
Immediately after dequeuing a server, but before enqueuing the runnable for execution.
Once the interrupt is released, both types of server continue normal execution.
Canceling a Server
Canceling an RWRunnableServer instance causes the server to attempt to cancel any current, non-threaded runnable being executed.
Canceling an RWServerPool instance causes the server pool to attempt to cancel all runnable server instances within its pool. Each of these runnable servers in turn attempts to cancel the current runnable, if any, that they are currently executing.
Using Server Pool Thread Attributes
Each runnable server thread in a server pool can be initialized using a thread attributes instance. All threads created following server pool startup have the same attributes because the pool attributes are copied when the server pool is started. Changes to the pool thread attributes do not have any effect until the next time the server pool is started. New runnable server threads added as the result of a resize operation use the thread attribute values as defined when the server pool was started, ignoring any recent changes.