Boost logo

Boost Users :

From: frederic.mayot_at_[hidden]
Date: 2007-08-30 12:08:51


Hi,
I'm having a problem with mutexes.

In one thread T1 I have:
while(!end)
{
 /* TTT */
  lock lk(mutex);
  dosomethingquick();
}

In another thread T2 I have:
void f()
{
lock lk(mutex);
doanotherthingquick();
}

I'm sure dosomethingquick returns but T2 can never acquires the mutex.
If I had a timer on line /* TTT */ in T1 (sleeps for a millisecond),
everything works fine.

Can anyone understand such a behavior? Am I doing something wrong here?

Thanks,
____________________________

Frederic MAYOT
Société Générale - Equity IT
1221 Avenue of the Americas
New York, NY 10020
+1 (212) 278-5558
+1 (917) 673-1339

*************************************************************************
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified.

*************************************************************************



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net