Multithreaded drivers (agin)

Scott Lystig Fritchie <>
Tue Jul 25 18:24:31 CEST 2006


>>>>> "oh" == Oscar =?ISO-8859-1?Q?Hellstr=F6m?= <Oscar> writes:

oh> By not passing it a key, "the threads from the pool are used in a
oh> round-robin way", but even with this behaviour, it seems one of
oh> the requests are being queued in a already busy thread.

My knowledge about multi-threaded drivers may be slightly out-of-date,
so I hope someone will correct me if I'm wrong.

If you specify no key (for the round-robin behavior), I don't believe
there's a guarantee that the round-robin will avoid worker pool
threads that are already busy.(*)  Sorry it's been a few years since I
last looked at the stuff.  Some debugging steps I'd suggest:

    1. Does the execution behavior change if you increase the size of
       the worker thread pool (+A whatever)?

    2. If you add a printf() (or whatever) to display the value of
       pthread_self(), as executed by a worker pool thread and not the
       VM's master/main/parent/whatever thread :-), are you always
       seeing the same thread ID?

-Scott

(*) It used to be that way.  I dunno if R10-B or R11-B changed that
bit of behavior.



More information about the erlang-questions mailing list