Re: Patches for review: vat shutdown

Bill Frantz <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <r314ps-1064i-390CE7AD55FF443096DB231D024BF2E3@Bill-Frantzs-MacBook-Pro.local>
On 10/25/10 at 3:16 AM, tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected] (Thomas 
Leonard) wrote:

>2. Removed UserThread that was created per ListenThread
>
>http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/
>f5f366d279be6343a92d3eaddd43a4d951f12bc6
>
>(unless someone can explain what this was for)

 From the Javadoc for ListenThread:

HACK: The listener thread needs to be a daemon thread, because 
if it were a user thread it would be uninteruptible while it was 
off waiting on an accept() (this is due to a flaw in Solaris, 
actually). However, if it's a daemon thread the app can exit 
even if the thread is still running. However, if we're just 
sitting there waiting for connections to arrive over the 
network, we don't want to exit, we want to keep running. Thus we 
have the net.vattp.data.UserThread, which does NOTHING but wait. 
Since it's a user thread it keeps the app from exiting (and thus 
allows the listener thread to keep running waiting for a 
connection) and since it's not waiting on an accept we can kill 
it. When we tell the listener thread to shutdown (which we now 
can do since it's a daemon thread), it sends a notify() to the 
listener user thread whereupon *it* shuts down too. Hallelujah, amen.


It seems to me that if the Solaris bug has been fixed, the hack 
(and UserThread) can be removed.

Cheers - Bill

-------------------------------------------------------------------------
Bill Frantz        | Airline peanut bag: "Produced  | Periwinkle
(408)356-8506      | in a facility that processes   | 16345 
Englewood Ave
www.pwpconsult.com | peanuts and other nuts." - Duh | Los Gatos, 
CA 95032
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.