|
Replies:
1
-
Pages:
1
-
Last Post:
Jul 12, 2010 4:42 PM
by: anthony.williams
|
|
|
Posts:
10
From:
NC
Registered:
7/12/10
|
|
|
|
looks like there is no "semaphore" key word in std::thread
Posted:
Jul 12, 2010 4:32 PM
|
|
i didn't dig deep enough by myself yet. Could any one or the author explain briefly why there is no such key word? or something equivalent can be used in std::thread? Thanks.
|
|
Posts:
169
Registered:
6/6/08
|
|
|
|
Re: looks like there is no "semaphore" key word in std::thread
Posted:
Jul 12, 2010 4:42 PM
in response to:
botaojia
|
|
A semaphore is a low-level, multi-purpose synchronization tool. As such it is hard to use correctly.
The C++ thread library does not provide a semaphore. Instead it provides the things you would build with semaphores --- mutexes, condition variables and futures.
|
|
|
Legend
|
|
Gold: 300
+
pts
|
|
Silver: 100
- 299
pts
|
|
Bronze: 25
- 99
pts
|
|
Manning Author
|
|
Manning Staff
|
|