10.7 Multithreading and the XPCE graphics system
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Multithreaded applications
        • Multithreading and the XPCE graphics system
          • in_pce_thread/1
          • in_pce_thread_sync/1
          • pce_dispatch/1
    • Packages
Availability::- use_module(library(pce)).(can be autoloaded)
Source[semidet]in_pce_thread_sync(:Goal)
Same as in_pce_thread/1, but wait for Goal to be completed. Success depends on the success of executing Goal. Variable bindings inside Goal are visible to the caller, but it should be noted that the values are being copied. If Goal throws an exception, this exception is re-thrown by in_pce_thread/1. If the calling thread is the‘pce thread’, in_pce_thread_sync/1 executes a direct meta-call. See also in_pce_thread/1.

Note that in_pce_thread_sync/1 is expensive because it requires copying and thread communication. For example, in_pce_thread_synctrue runs at approximately 50,000 calls per second (AMD Phenom 9600B, Ubuntu 11.04).