Seeking feedback on C++ ZThreads: good or bad experiences (vs Boost, pthreads, etc)?

M

Matt England

My team currently using Boost Threads, but we are considering
switching to ZThreads. (We seek cross-platform, C++ multithreading
capabilities in an external library.)

ZThread(s):

http://zthread.sourceforge.net/
http://www.inf.uni-konstanz.de/dbis/members/vinnik/zsim/doc/

Can anyone share their ZThreads experience, either good, bad, or
indifferent? If you have time, can you also contrast ZThreads with
alternative, cross-platform threading libraries (as per:
http://www.codeguru.com/forum/showthread.php?t=413251 ).

Also note:

http://www.codeguru.com/forum/showthread.php?t=413255

Best regards,
Matt
 
I

Ian Collins

Matt said:
My team currently using Boost Threads, but we are considering
switching to ZThreads. (We seek cross-platform, C++ multithreading
capabilities in an external library.)
I guess the obvious question is why?

What are your specific requirements that boost doesn't meet and ZThreads
does?
 
H

Howard Hinnant

Matt England said:
My team currently using Boost Threads, but we are considering
switching to ZThreads. (We seek cross-platform, C++ multithreading
capabilities in an external library.)

ZThread(s):

http://zthread.sourceforge.net/
http://www.inf.uni-konstanz.de/dbis/members/vinnik/zsim/doc/

Can anyone share their ZThreads experience, either good, bad, or
indifferent? If you have time, can you also contrast ZThreads with
alternative, cross-platform threading libraries (as per:
http://www.codeguru.com/forum/showthread.php?t=413251 ).

Also note:

http://www.codeguru.com/forum/showthread.php?t=413255

Wow, your post is most timely Matt. I'm most interested in what
features of Boost Threads you liked and disliked, the reasons for your
contemplating a move, and what features you are anticipating will solve
your problems with ZThread.

Howard Hinnant
Library Working Group Chairman, C++ Standards Committee
 
Z

Z.Meson

Wow, your post is most timely Matt. I'm most interested in what
features of Boost Threads you liked and disliked, the reasons for your
contemplating a move, and what features you are anticipating will solve
your problems with ZThread.

Howard Hinnant
Library Working Group Chairman, C++ Standards Committee- Hide quoted text -

The most obvious thing that jumps out to me is that ZThreads has more
pre-built high-level abstractions than Boost Threads (and a few more
low-level primitives too).

For example, ZThreads provides the following while Boost threads does
not:
- Thread pools (PoolExecutor)
- Semaphore class
- Atomic integer

While Boost threads' documentation mentions that the next phase will
include more high-level concepts, Boost threads doesn't seem to have
been updated in a 18 months.

The good things about both libraries is that they are written in C++
(as opposed to the pthreads library which is a C library). The thing
that bothers me with both ZThreads and Boost threads is that neither
support inter-process semaphores (or for that matter inter-process
threads) nor shared memory functionality. Windows threads API and
most implementations of pthreads (including those on Solaris, Linux
kernels 2.6 and later, Win32 implementation of pthreads) support
interprocess-semaphores. Windows and many POSIX implementations
support shared memory functionality. And as far as atomic operations
goes, ZThreads only seems to support atomic increment and decrement --
no atomic compare and swap functionality.

As far as naming goes and general class design, I prefer Boost
threads. The naming conventions is more in-line with the C++ standard
libraries and the rest of Boost. The general class design seems very
well thought out as well. (I wouldn't have implemented many of the
concepts in ZThreads differrently - why have a FastMutex class that
seems to have the same interface as the plain Mutex class?) I just
feel that Boost threads is too incomplete and that despite the promise
made in its documentation, it hasn't really been actively worked on in
a while.

So, a worthy question is what do I use in applications that I have to
write? I have resorted to writing my own cross-platform library that
focusses more on interprocess-primitives, shared memory, and atomic
operations as these are more important to the work that I do.

- Kevin Hall
 
Z

Z.Meson

support inter-process semaphores (or for that matter inter-process
threads)

Forgive me... my son kept me up all night and I'm pretty tired.
Obviously, inter-process threads doesn't make any sense.

I meant to say:
"(or for that matter inter-process mutexes.)"
 
N

n.torrey.pines

Wow, your post is most timely Matt. I'm most interested in what
features of Boost Threads you liked and disliked, the reasons for your
contemplating a move, and what features you are anticipating will solve
your problems with ZThread.

Howard Hinnant
Library Working Group Chairman, C++ Standards Committee


I agree with the other poster about thread pools. As multi-core CPUs
become increasingly common, the use of threads solely to speed up
parallelizable processes will be prevalent. For this, having thread
pools is essential.

It appears that Boost.Threads is not actively developed. There was a
DDJ article as far back as April 15, 2003 about Boost.Threads that
mentioned that boost::thread_pool was a planned feature, but I don't
think this feature was ever delivered.
 
N

n.torrey.pines

Wow, your post is most timely Matt. I'm most interested in what
features of Boost Threads you liked and disliked, the reasons for your
contemplating a move, and what features you are anticipating will solve
your problems with ZThread.

Also, for the reasons I mentioned, I think it would be nice to have a
portable way to determine the number of CPUs/cores, to avoid spawning
too many threads.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

C++: The Good and Bad 17
comp.lang.java.gui FAQ 0

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top