-
November 14th, 2011, 11:33 AM
#1
boost::thread and boost::promise
I have some question about After studying the website of boost and "C++ concurrency in action"
I still can't get the idea of According to the book(if I have no make any mistake)
boost::future is designed for one off event
you could wrap the task by packaged_task and let boost::unique_future
to gain the result of the task. When you launch the thread, you could
just return the boost::unique_future and wait for the result of the task.
After the task is finish, you could continue your job.
It is very like boost::condition_variable but design for one off event.
Do I make any mistake about it?
Assume that I didn't make any mistake about the idea of future, I still can't
get the idea of , could you show me an easier example of it?
Thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|