
22 Apr
2005
22 Apr
'05
11:25 a.m.
All,
I have found a very strange behaviour (for me at least!) in
boost.Thread.
The same dummy code:
boost::mutex M;
void functionA(int j)
{
for(int i=0; i

22 Apr
22 Apr
12:13 p.m.
New subject: Mutexes (Was: (no subject))
Hi Przemyslaw, (btw, it's better to give some subject to postings).
And it would be good if the code was properly indented.
sqrt(static_cast<double>(i));
If you lock the mutex, then only one thread can be inside loop body at the moment. Since the code outside of mutex is very small, most of the time only one thread will be running. So, it's reasonable that OS uses just one processor. - Volodya
7314
Age (days ago)
7314
Last active (days ago)
1 comments
2 participants
participants (2)
-
Sliwa, Przemyslaw (London)
-
Vladimir Prus