Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Critique my simple thread pool

Name: Anonymous 2011-10-14 7:20

Learning parallel programing and pthreads so I tried my hand at writing a thread pool.

http://pastebin.com/ebrVWFa8

Name: Anonymous 2011-10-14 7:29

If it ain't Lisp, it's crap.

Name: Anonymous 2011-10-14 10:40

Lisp is shit.

Name: Anonymous 2011-10-14 11:40

Rewriting slist from scratch

Typical C program.

Disregarding that, have you tried feeding it to helgrind?

Name: Anonymous 2011-10-14 12:13

Using shit++

Typical shit programmer

Name: Anonymous 2011-10-14 12:30

One argument is not enough; you should create a mechanism that will allow the user to supply multiple arguments, which will in turn be converted into a struct, which will be stored as void *arg in task.

Name: Anonymous 2011-10-14 15:28

>>1
That's nice and all, but you're reinventing the wheel.

Just use libdispatch.

If you're on OSX or FreeBSD you're already set. With a Debian based OS, including Ubuntu and Linux Mint, just: $ sudo apt-get install libdispatch-dev.

Fedora is also getting it in the next major release.

Name: Anonymous 2011-10-14 21:37

It works most of the time. But I'm trying to write a simple threaded quicksort using it and for some reason it's only executing the first task I dispatch.

>>4
I still have a data race when killing it but it's simple to fix.

>>6
How would I define variable field structs dynamically? Is it even possible to define types at runtime?

>>7
Wrote this for class and teach won't let us use external libraries.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List