FUNCALL-ASYNC
I really like this function, provided by the LW7 MP package. I have migrated my dispatch queues away from firing off dedicated handler threads, to using FIFO and Priority Queues managed by whatever worker threads are available. Since we can’t really run more parallel threads than we have in machine cores, this makes good use of the machine without overtaxing the MP system in the kernel. All it requires is noticing, after enqueuing a closure, whether or not a dispatch queue is currently owned by a handler thread, denoted via CAS on a thread ID slot. And if the system isn’t already under way, just fire off a dispatch hander with FUNCALL-ASYNC. The system will eventually get around to it, claim ownership, and if any excess firings occurred, they will simply quit on not being able to CAS the ownership slot for themselves. No more explicit PROCESS-RUN-FUNCTION. Any number of concurrent serial dispatch queues. Not that it really much matters, but I would be curious is this is using Mac Grand Central Dispatch? (Probably not, since it runs on Posix Threads across all implementations of LW). - DM _______________________________________________ Lisp Hug - the mailing list for LispWorks users lisp-hug@lispworks.com http://www.lispworks.com/support/lisp-hug.html