Juergen Kreileder wrote:
> 

> 
> Please note that it is perfectly legal with respect to the JLS to
> implement Thread.yield() as nop in JVMs based LinuxThreads.  Actually
> it is not only legal, it's desirable to implement it as nop on JVMs
> that employ preemptive scheduling policies (especially on
> multiprocessor machines).

Look, if Thread.yield() is ever called by the programmer, he has a
reason for it.
In my case, I'm calling it because I want the thread handling the rmi
call to return before the thread that calls exit() calls exit() because
I don't want the client to get an EOFException.  With the 2.2.15 kernel
it worked perfectly.  With 2.4.0 it doesn't, and my clients are getting
EOFExceptions.

    public void exit() throws RemoteException{
        
            new Thread((new Runnable(){
                    public void run () { Thread.yield() ; System.exit(0); }
                })).start(); //allow this method to end so the client doesn't get an
error.
        
    }


> 
> Given the loose semantics of Thread.yield(), it is merely a pure
> heuristic *hint* to the JVM.  The JVM may interpret this hint in any
> way it likes.

May doesn't mean should.  I imagine the spec was so loose because it
could be expected that fine control over the threading might not be
available to the implementors of the jvm on every platform, not because
the writers of the spec didn't think Thread.yield() would be useful.

 
-- 
Joseph Shraibman
[EMAIL PROTECTED]
Increase signal to noise ratio.  http://www.targabot.com


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to