[1669] in java-interest

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

Threads don't make sense

daemon@ATHENA.MIT.EDU (mpasqui@UOFT02.UTOLEDO.EDU)
Wed Sep 13 17:34:18 1995

Date: Wed, 13 Sep 1995 13:56:37 -0400 (EDT)
From: mpasqui@UOFT02.UTOLEDO.EDU
To: java-interest@java.sun.com
Cc: mpasqui@UOFT02.UTOLEDO.EDU


I'm kind of confused on the 'yield' issue. As I understand it
(which could be my first problem) threads of the same priority will
only yield the CPU to threads of higher priority. This implies that they
will not give the CPU to threads of the same priority unless the
yield() statment is encountered. Therefore, since threads in applets,etc
are often the same priority the yield statement effectively becomes
a flag for competing threads to 'take the CPU and I'll goto sleep'.

So the question is, what good is the synchronization modifier?
Two threads couldn't be in the same method at the same time anyway
since the first must specifically and purposefully yeild to any others
(i.e. the first 'could' yeild inside a synchronized method but that
seems to detract from the whole idea even further).

Any example of a critical section that could evolve into a race
condition without the synchronize modifier would make me a believer.

thanks

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

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