If your application does not scale as your threads increase, you should check the code to make sure there are no hidden mutexes limiting your concurrency.
Logging System
Andrei Alexandrescu gave the keynote speech at Boostcon 2009. The speech's title was "Iterators Must Go." I did not have the opportunity to attend this year's Boostcon, but the slides of the keynote are available online.
Almost a year ago now I promised a series of articles on cross-platform C++.
Since then, I have finished porting a relatively large C++ project that I wrote to Linux, Solaris, and Windows. I've learned that C++ is really quite portable and there are just a few guidelines that you should keep in mind.
Use the Appropriate Compiler
Unfortunately, if you want to download a pre-compiled Boost for Visual Studio, you are required to register for an account with boostpro.com. When I was looking to download Boost for Windows recently 1.38 was not yet available precompiled and I personally did not want to register for an account to download free software, so I built it myself.
Fortunately, the process is very simple:
In my last posting about C++ Multiple Dispatch I wondered if it was really any different than function overloading. I now appreciate that it is something that needs to occur at runtime, not compile time. With a little help from the Boost libraries, I threw together this example of how one could do Multiple Dispatch in C++.
If boost::threads represent the C of multithreaded programming, then RAII and automatically managed threads represent the C++ of multithreaded programming.
In the last article we promised that using more RAII would allow us to get this code even smaller and better to manage. Here is the result of that:
class threaded_class { public: threaded_class() : m_stoprequested(false), m_thread(boost::bind(&threaded_class::do_work, this)) //Note 2 { } ~threaded_class() {
Recent comments
16 hours 22 min ago
1 day 22 hours ago
2 days 7 hours ago
1 week 4 days ago
2 weeks 1 day ago
2 weeks 3 days ago
3 weeks 14 hours ago
3 weeks 14 hours ago
3 weeks 2 days ago
4 weeks 8 hours ago