Re: What you get is what you want
Jean Morissette <[email protected]> Sat, 13 Nov 2004 17:50:11 -0500
| Newsgroups | gmane.comp.java.seda.user |
|---|---|
| Message-ID | <[email protected]> |
> And a stage or a queue should only expect an API, not classes, to be provided in its environment. > At best, the thread class should implements an interface, so that you would use > > ((ISandstormThread)Thread.currentThread()).setBlocked(+/-) I agree with you :-) But all that is only implementation details. A more important question is the algorithm that we will use to decide if yes or not we allocate a new thread in a pool when other threads in this pool are already blocked in a blocking_enqueue operation. Here are some simples (and maybe wrongs) possibilities to decide to not allocate a thread: *One* thread in the ThreadPool wait to have the 'blocking_enqueue' lock (because another thread already have it). *All* threads in a ThreadPool wait to have the 'blocking_enqueue' lock. We want to enqueue (with blocking_enqueue) to a queue that is full, or almost full. Suggestions? Jean ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8