Hi Folks,

   I had this floating at the back of my mind for quite some time. There is a
facility in the OpenSolaris kernel called Task Queues that make it downright
easy to dispatch tasks to threads without having to do the thread management
yourself. This framework is extensively used in the the OpenSolaris kernel and
is also used by a ZFS userland library for thread handling. If you are
interested
in the full details please see:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/taskq.c

There are extensive comments at the top of that file. Now this is eminently
useful for general application programming, letting the developer dispense with
thread handling code and focus on the algorithm. So i went ahead and pulled
out the taskQ code out of libzpool and created a new library named
"intelligently"
as "libtaskq"!

Given that we are moving more and more towards parallelism via multicore for
general-purpose systems we need this approach, and Task Queues make it
very easy to use threads. I currently have a buildable library which I have not
tested yet, but wanted to give a heads-up and invite collaboration.

There are several possibilities to extend this for parallel programming tasks.
The source code can be found here:
http://belenix.svn.sourceforge.net/viewvc/belenix/trunk/misc/libtaskq/?pathrev=371

You can check out that piece using this command:
svn co https://belenix.svn.sourceforge.net/svnroot/belenix/trunk/misc/libtaskq
libtaskq

Typing make in that directory will build the library. Looking forward to some
interesting collaborative work in developing this forward.

Regards,
Moinak.
-- 
================================
http://www.belenix.org/
http://moinakg.wordpress.com/

Reply via email to