Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I once used <a href="http://people.clarkson.edu/~jmatthew/cs644.archive/cs644.fa2001/proj/locksmith/code/ExampleTest/" rel="nofollow">this</a>, which isn't actually an official implementation per se. It does use pthreads as you requested, and should give you some ideas of what you need to do. (See <code>threadpool.h</code>, <code>threadpool.c</code>, <code>threadpool_test.c</code>, and the <code>Makefile</code> for instructions on how to compile.) You'll obviously have to do some refactoring as <a href="http://people.clarkson.edu/~jmatthew/cs644.archive/cs644.fa2001/proj/locksmith/code/_README_" rel="nofollow">it's original intention</a> is probably different than yours. It's commented rather well actually.</p> <p>Even though this deviates from the original question, I'd also like to mention that the newest C standard, unofficially C1X (see wikipedia, hyperlink limit), has planned support for threads N1570 (google it, hyperlink limit again!) (7.31.15).</p> <p>Some personal advice from my experience would be to make sure that your application <em>can</em> actually be run in parallel, and if the overhead of creating a new thread is so high that you can't live without a thread pool. Personally I've blundered on both these parts and I've actually ended up with implementations slower than my single threaded application. Also, you might want to be aware of different problems, including cache-lockouts and misses, which would actually degrade the performance of your application.</p> <p>I'm probably blabbering on by now, but best of luck.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload