For most Boost's libraries its documentation requires you to read everything from the start to the end before you can write any code. Compare that with most of CPAN modules where usually you can start using CPAN module after quickly scanning synopsis and maybe description parts of it's POD documentation. POD documentation as a rule has good examples right on top of the page. Boost's documentation usually doesn't.
So I was looking for basic usage examples for boost::thread and boost::mutex classes and initially I couldn't find any because I was using wrong search keywords. In the end I figured out how to use boost::thread and boost::mutex classes in my application hard way by reading Boost documentation without relying on any examples. But afterwards I did find a very good article on this topic with many simple examples: The Boost.Threads Library on Dr.Dobb's. So I'm posting this link here for google. It is in top 10 hits for some relevant keywords but it is not for others (for example for boost thread mutex tutorial) and this is why I missed it initially. If my blog post helps any Boost.Threads newbie to get started then I would consider time spent writing this post to be not wasted.
Wednesday, July 25, 2007
boost::thread and boost::mutex tutorial
Posted by Ilya Martynov at 8:35 PM
Labels: boost, c++, documentation, programming, threads
Subscribe to:
Post Comments (Atom)
57 comments:
Thanks.
Not wasted at all! Ta!
Thanks, your time was definitely not wasted and in fact has helped save time for at least one poor sap working his way through the Boost.Thread documentation.
Thanks! This page served its purpose perfectly for me.
Thanks! Wasnt a waste of time.
Thanks :)
Looks like you might have helped me a lot there too mate. Thanks a lot :D
Thanks !
Thanks! I had been searching for stuff on C++ threads and hadn't found a good article or tutorial on them until I typed in "C++ threads boost tutorial" and got your page and followed the link.
Thanks! not wasted time ;)
Thanks! This is a good place to drop by when searching for Boost.Thread tutorial.
Thank you very much. Your link is very useful:)
Thanks a lot for your link though the article seems a bit obsolete now.
I also found a good article here:
http://blog.emptycrate.com/node/277
Cheers
Thanks. This was exactly what I was looking for.
Pitty the Boost.org people can't write examples on their own. ;o)
Thanks alot
I got the same feeling with you while looking for a pratical, handy guide of boost thread, now I found this tutorial. So, thanks.
Another thanks :D
Thanks for the tutorial. Something human readable, win!
Thank you very much.
Me too. (-:
Thanks a lot.
Thanks for this! Definitely quite understandable. There's another quite good tutorial here:
http://paulbridger.net/multithreading_tutorial
The problem with that one is that there're no COMPLETE examples - however, it does explain the concepts more thoroughly. :)
Also, be sure to check out the "What's new in Boost Threads by Dr.Dobb's:
http://www.ddj.com/cpp/211600441
Haven't read it yet, but apparently there's stuff about a newer version of the library.
Happy coding people! :)
thanks ... i feel ya ... i like to learn thru examples
Thank you!!
Thanks mate, another quick piece of info on using Boost threads on a class is: http://ubuntuforums.org/showpost.php?p=5392618&postcount=4
explains how to use to make a class similar to if you inherit from Thread in Java.
Thanks for the link. I was going cross-eyed reading the Boost::Thread docs and it turns out I only needed two extra lines in my code. :^)
It's still the gift that keeps giving.
And btw, if any readers are C++ newbs like me, and have trouble with the example code, the keys to learn are "Initialization Lists"
http://www.cprogramming.com/tutorial/initialization-lists-c++.html
and "functors" or "Thread Functors"
http://developer.vrjuggler.org/docs/vapor/2.0/programmer.guide/programmer.guide/ch05s02.html
Thanks a lot !
thanks!!
Whoever is responsible for the Boost threads documentation should be ashamed that this blog is the number one hit for boost thread tutorial, and there is nothing on the web for it from boost itself... But thank you blogger!
Thank you !
Thanks! when i searched today you were the number 1 google hit for "boost thread tutorial"
thanks, you pointed out something i've been frustrated by with boost documentation for years and you pointed to the same example i had in mind, CPAN/POD
thanks :p
It looks like google like your article it's was my 3rd result !
Still working after 2.5 years! Thanks Ilya!
Many thanks
this is exactly what I am looking for!
youuuuuuuu rock. made my search quite easy
yeah it helped! I never write comments on blog posts, but this one deserves it! Thanks!
Still not wasted! :)
thanks!
Thank you very much, i found this post via google, so it was worth (IMO).
cheers
Thanks a lot. Saved me hours of time reading docs.
Thanks :-)
Thanks!
Still paying off. Thanks!
Good stuff mate, and thankyou very much for the Dr Dobbs link. That is exactly what I was looking for.
+1, your idea worked. Came from Google.
Thanks a lot, still working!!
As everyone else says - thanks! :P
Thank you, I was really strugling using the Win32 API for multi-threading but now I use boost which is so much easier once you read the documentation!
thanks
Still kickin; !!!
Good work Sir!
Thanks bro!
Usefull post ... thanks man!
March 2012 and still useful.
Thanks!
July/2012...
... and still usefull.
Great! Thank you :-)
6 years after... thanks ;)
Post a Comment