By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

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

P: n/a
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/...nnik/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
--
Dispersed Storage: http://cleversafe.org
Jan 30 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
To email me directly, please remove the "downwithspammers-" text.

-Matt

On Tue, 30 Jan 2007 17:33:48 -0600, Matt England
<ma**@downwithspammers-mengland.netwrote:
>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/...nnik/zsim/doc/
Jan 30 '07 #2

P: n/a
Matt England wrote:
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?

--
Ian Collins.
Jan 31 '07 #3

P: n/a
In article <i3********************************@4ax.com>,
Matt England <ma**@downwithspammers-mengland.netwrote:
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/...nnik/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
Jan 31 '07 #4

P: n/a
On Tue, 30 Jan 2007 17:33:48 -0600, Matt England wrote:
>My team currently using Boost Threads, but we are considering
switching to ZThreads. (We seek cross-platform, C++ multithreading
capabilities in an external library.)
You may also consider pthreads (C not C++) for which a Windows
implementation is also available:
http://sourceware.org/pthreads-win32/

Best wishes,
Roland Pibinger
Jan 31 '07 #5

P: n/a
On Jan 30, 6:36 pm, Howard Hinnant <howard.hinn...@gmail.comwrote:
Matt England <m...@downwithspammers-mengland.netwrote:

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

Jan 31 '07 #6

P: n/a
On Jan 31, 7:44 am, Z.Me...@gmail.com wrote:
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.)"

Jan 31 '07 #7

P: n/a
On Jan 30, 6:36 pm, Howard Hinnant <howard.hinn...@gmail.comwrote:
In article <i3lvr25d4muuls5qb9rq5bss2o2ij4c...@4ax.com>,
Matt England <m...@downwithspammers-mengland.netwrote:
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/...nnik/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

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.

Feb 2 '07 #8

P: n/a
On Jan 30, 6:36 pm, Howard Hinnant <howard.hinn...@gmail.comwrote:
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.

Feb 2 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.