Joseph Shraibman 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.

Look, if the programmer uses Thread.yield() in a way it was not designed for
than the reasons for it simply don't matter. It may have worked in some
environments, but that does not mean you can expect all environments to work
this way.  

> 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.

Yeah. So what? Do it right. "Java Thread Programming" by Paul Hyde describes
possible (correct) solutions to your problem (the problem being "one thread
needs to wait for another one to finish" if I interpret this correctly).
Thread.yield() is not one of the correct solutions.

Thread.yield() means "I have nothing to do right now, you may use the CPU for other
purposes". Nothing more, especially no "you HAVE to use the CPU for..." .


Ciao....


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

Reply via email to