Re: thread::mutex lock problem, a bug?
- From: "Zoran Vasiljevic" <zv@xxxxxxxxxxxxx>
- Date: 2 Feb 2006 10:54:01 -0800
Well, starving... no wonder! You have a tight loop w/o any
potential yield points. Normally at some point in your code
the thread should "yield" allowing the scheduler to run
another thread. If you call any of certain system calls
like read, write, select etc... the scheduler willl put your
thread to sleep and run the next thread which is ready to
run. If your code does not call any of those, as in your example,
then it might be that one thread works for couple of seconds
before its quantum is expired. This all is pretty OS dependent
and you will get different results on different boxes.
I cannot consider this a bug. This is just a normal behaviour.
If you put "after 1" somewhere in your loop, the "starvation"
will dissapear.
The original problem you posted was a real show-stopper.
I had a very stupid race condition there (I was naive) which
led to a deadly-embrace type of problem. This is now fixed.
Cheers
Zoran
.
- Follow-Ups:
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- References:
- Re: thread::mutex lock problem, a bug?
- From: Abuda
- Re: thread::mutex lock problem, a bug?
- Prev by Date: Re: Segmentation fault in internal Tcl function
- Next by Date: Re: Segmentation fault in internal Tcl function
- Previous by thread: Re: thread::mutex lock problem, a bug?
- Next by thread: Re: thread::mutex lock problem, a bug?
- Index(es):