Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Q support multithreading?

multithreading support
0
Posted

Does Q support multithreading?

0

Yes. As of Q 3.1, on systems where the POSIX threads library or some compatible replacement is available (this includes Windows and most modern UNIXes), the interpreter can be built with POSIX threads support, and is reentrant via the C interface, provided that you register threads which need access to the internals of the interpreter; see the libq header file for details. Moreover, the clib module provides a fairly complete set of bindings for the POSIX thread functions. With these facilities you can implement multithreaded scripts which concurrently evaluate expressions in different threads. Besides thread creation, termination and cancellation, the usual synchronization features (mutexes, conditions and semaphores) are all supported. Clib actually implements semaphores as semaphore queues, which makes it possible to send expression values from one thread to another.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123