I already use some new features from C++0x in Visual C++ 2010, like regular expressions or lambda functions. But there is one major feature that is missing: the <thread>
header .
Do you know any code which could act as a replacement ?
For the moment I'm using boost's thread, but it's not exactly the same as the standard, and it gives me huge compile times. I also found just::thread, but being an amateur I don't want to spend money on it.
I don't think it would be too difficult to code (though I may be wrong) but I don't know the Win32 API enough to do so.
I have used boost::thread
in performance-sensitive production code and it's way more sophisticated and performant than anything we could have built ourselves in a sensible amount of time. The reader-writer lock in particular is a thing of beauty imo. You have the added benefit that the person who wrote the code and the book is active on Stack Overflow, if you do need help.
Since you are on Windows you may be able to improve compile-times by judicious use of Visual Studio precompiled headers , to avoid repeated load of the Boost headers.
I think that boost::thread
is your best bet. It's throughly tested, and the std::thread
is based on it. You should just keep in mind the different areas and try to deal with them the best you can.
As specified here :
You can use the win32 thread functions. There are rather simple to use and only require a few function calls to get working. A quick google search should solve all your problems.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.