Re: What you get is what you want
Jean Morissette <[email protected]> Sat, 13 Nov 2004 13:02:44 -0500
| Newsgroups | gmane.comp.java.seda.user |
|---|---|
| Message-ID | <[email protected]> |
Quartz wrote: >>We could define an abstract class which all others threads specifics to TM could extends: > > > Extension. Right. No thanks. Thread.currentThread() shouldn't even exist. Why? > No more than > Thread.sleep(). These only bring trouble and they have favorable workaround. > I used currentThread() because I didn't know about ThreadLocal back then. Sleep should always be a > wait with someone ready to notify() somewhere instead of having to interrupt. I am agree with you that, in a design point of view and almost always, its better to use ThreadLocal than creating a specific thread class with specific attribute. But, the fact is that using ThreadLocal is more slow than a downcast. Because blocking_enqueue is a performance-critical operation, I prefer using a downcast. Also, Sandstorm is already responsible to create and manage all threads, thus it don't seems a bad design solution. 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