[5206] in java-interest

home help back first fref pref prev next nref lref last post

Can you write a selfish thread that does graphics?

daemon@ATHENA.MIT.EDU (Cay Horstmann)
Thu Feb 1 23:13:30 1996

From: Cay Horstmann <horstman@jupiter.SJSU.EDU>
To: "'java-interest@java.sun.com'" <java-interest@java.sun.com>
Date: Wed, 31 Jan 1996 21:54:34 -0800

I tried to write a graphical version of the "selfish thread" program in the 
Java tutorial, where the selfish thread doesn't call sleep() but waits in a 
loop, then repaints itself, then goes back to a busy loop, all 1000 times.

This is on Solaris where the text-based "selfish thread" program clearly 
shows that the selfish thread doesn't give up control once it is running.

But in graphics mode it wasn't all that selfish--it time sliced just fine.

Hence my question: Does a call to one of the graphics routines
(in my case g.fillOval(...)) give another thread a chance to butt in? Is 
that well-defined or just an artifact of the Solaris implementation?

Cay
horstman@cs.sjsu.edu

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post