Threads are independent streams of execution that run concurrently (or at least
with the appearance of concurrency), possibly on multiple CPUs. If you want to
coordinate activity between threads -- such as determining a sequence in which
output appears -- you have to use the tools available for thread coordination.
That's why Java gives you constructs such as "synchronize" as part of the
language.
You cannot, should not, must not, rely on unspecified behavior, such as how much
of a time slice each thread gets, whether threading is preemptive, the order in
which threads get time slices, the relative time threads get for different
priorities, etc. If you want to coordinate activity between threads, you're
going to have to deal with "inconvenient and very difficult" programming. Java
makes this task much easier than do other environments, but you still have work
to do.
Nathan
> hi,
> i still have some more questions about threads and the differences
> between
> linux-windows95.
> In my application I got a similar behaviour between linuxwin95 if I set
> the
> Priority = 1 on linux. On win95 it is 5. Is the behaviour of these
> values
> somewhere defiened or does it depende on the virtual machine. If it
> depends
> on the virtual machine how can I write programms which behave same or
> similar on both platforms ?
> One solution might be that all threads must communicate during there
> execution about the methode interrupt(). But I think that this is often
> very
> inconvinient and (in my case) very difficult to implemente. So in my
> case it
> would be the best if the behaviour of a thread is well defiened.
---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]