On Nov 19, 2009, at 5:51 PM, Prakash Sangappa wrote:
I am interested in finding out more about the pthread workqueue API that libdispatch uses. Is there any documentation / man pages available?
Hi, I have spending some quality time with the pthread workqueue API and all the documentation I could find was the source code (see pointers to source below). I suspect that there might be some internal apple docs given that a little dtracing reports that this API is very popular with darwin apps. Kernel bits: http://fxr.watson.org/fxr/source/bsd/kern/pthread_synch.c?v=xnu-1456.1.26 Pthread bits: http://www.opensource.apple.com/source/Libc/Libc-583/pthreads/pthread.c Search for: - pthread_workqueue_init_np() - pthread_workqueue_create_np() - pthread_workqueue_additem_np() - pthread_workqueue_attr_init_np() - pthread_workqueue_attr_destroy_np() - pthread_workqueue_attr_setqueuepriority_np() - pthread_workqueue_attr_getovercommit_np() - pthread_workqueue_attr_setovercommit_np() - pthread_workqueue_requestconcurrency_np() - pthread_workqueue_getovercommit_np() Also, I have a preliminary implementation of the pthread workqueue API for FreeBSD at: http://people.freebsd.org/~sson/thrworkq/ It "mostly" works on amd64/x86_64. Hopefully, I will have some time over the upcoming holiday to finish up some of the items I have listed on the TODO list. -stacey.