Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice or Boost threads?

Hi everyone,

I've just started learning Ice & am eagerly absorbing all the great design ideas. It's quite a steep learning curve, but does seem very well thought out. The documentation is excellent.

One of the design decisions I have to make is to use the Ice or Boost threads library.

I know you can't easily comment on the implementation details of third party libraries, but at a glance they do seem similar (not surprising as they both wrap around the same underlying concept).

Is there any particular reason why I should use one or the other? In other words, are there benefits in other areas of Ice if I'm using Ice threads?

One benefit that does occur to me is that by using Ice threads, I would not be linking against 2 sets of thread libraries (since Ice internally would use it) and making my application unnecessarily larger. Other than this they seem very similar to me.

Thanks,
Jeff Gray

Comments

  • matthew
    matthew NL, Canada
    I wouldn't use boost only for the threading support -- I'm pretty sure, with the exception of thread local data, the Ice threading libraries have all your bases covered. If boost has some other stuff you want to use then it makes sense to use it -- assuming, of course, all your desired platforms/compilers are covered.
  • bernard
    bernard Jupiter, FL
    Hi Jeff,

    I had a quick look at the Boost.Thread library and the latest version looks like a big improvement over previous ones.

    In a few years, C++ compilers will support C++0x with its new thread library, and at this time all existing thread libraries will be obsolete.
    Today, the closest thing to this future standard thread library is Boost.Thread; that's certainly one big advantage of Boost.Thread over IceUtil.

    IceUtil threads & sync may also have some advantages of its own:

    - it comes with Ice, so no extra library to use in your Ice-based application (as you mentioned)
    - you may like some features in IceUtil that are not in Boost.Thread (such as static mutexes and monitors)
    - there may be some quality of implementation differences that you care about, for example Ice is now using a monotonic clock for timeouts. I am not sure if Boost.Thread does the same.

    Ice is totally neutral with respect to the thread library you use; it doesn't provide special hooks or requires less coding if you use IceUtil instead of Boost.

    Best regards,
    Bernard