[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Another thread runs exclusively already." exception
On Thu, 01 Jun 2000, Timothy Reaves wrote:
> Thanks for the response Falko.
> We are seeing this on both MP and UP machines. It (seems to) happens not when more
> than one thread is started, but when it is done very rapidly.
Sorry but I dont know if I got this right: you get this exception if only ONE
transaction/thread is running?
> So the tester has a
> command line argument as to how many query threads to start and run. IF this
> number is, say, 10, no problem. If it is 100 problem Actually with 100 not only
> does this happen but an 'out of memory' exceptions is thrown as well, and this is
> problematic. I'll look into that later.
> Now, when 10 threads are started and finished, if I hit the up arrow key and hit
> enter to re-execute, again no problem. If I do it a third time, problem. So it
> doesn't seem to always happen repeatedly. One thing that will ALWAYS cause it is
> to start more than one thread that is in a loop that queries the users defined in
> the database. So the first tread starts and - until the tester is stopped -
> continually queries for defined users. If a second thread is started that does
> the same thing, the exception is thrown. This really shouldn't happen.
There is no public API to query the users. Of course there is an API but this
is intented to be used from adim tools only.
> The version I am using is 0.5-dev2. The line of code you reference is there,
> after the check is made. Shouldn't that be the first line of code executed inside
> the method?
If another thread runs exclusivly, then the current thread should never do
anything. So it makes no difference to execute the check at the beginning or
the end of this method.
> That way the first thread there is given the higher priority thus
> preventing another thread from possibly executing the check code before the first
> thread get the higher priority?
beginExclusion() is synchronized - this should avoid race conditions between
two threads that want to run exclusivly. Right?
> I see the code commented out dealing with stopping the other thread. What was
> wrong there?
The comment say: race conditions - but right now I don't see the problem.
Please try the commented code.
Falko Braeutigam mailto:email@example.com
softwarebuero m&b (SMB) http://www.softwarebuero.de