| Did you know ... | Search Documentation: |
| pce->multi_threading |
-language
interface at initialisation time if the
host-language
wishes to access XPCE from multiple threads. The
host-language
interface should use the functions pceMTLock() and
pceMTUnlock() as wrappers around access to XPCE.
This method fails with an error when invoked too late (for the X11 version this implies after the window system has been initialised). It fails silently if this version of XPCE is not compiled to support multi-threading.
XPCE multi-threading support is currently rather limited: it consists
of one global recursive mutex that ensures the system is
activated in a single-thread only. This mutex should be locked by the host-language
around access to the basic operations (send, get, new and
object) and is locked by XPCE itself for any event processed.
XPCE call-back occurs in the thread waiting for events. In the normal
XPCE/Prolog context this is the main-thread. As the system is locked
during event-processing, smooth interactive operation requires
event-processing to be completed quickly. If an event causes a long
operation to start the host-language
should run this operation in another thread.