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.

And still another question: 
        When should I use native threads, when green threads ? Is there
anywhere a paper about pro/contra of this both kind of threads ?


Thanks for discussing this questions

Holger





-----Ursprüngliche Nachricht-----
Von: Nolte, Holger [mailto:[EMAIL PROTECTED]]
Gesendet am: Dienstag, 11. Mai 1999 15:39
An: [EMAIL PROTECTED]
Betreff: java and multithreading

Hi, I am new at this mailinglist so I am not sure if the following question
is still discussed.
I am a little bit astonished about the java multithreating under linux. For
me it looks like that the multithreading with the semantic java is much
better. 

For example I tried the following programm:


class TestThread extends Thread {
        String txt;
        
        public TestThread(String t){
                txt = new String(t);
        }
        
        public void run(){
                for( int i = 0; i < 100; i++){
                    System.out.println( txt);
                }
        }
        
}


class main{
        
        public static void main(String[] args ){
                TestThread one, two, three;
                one = new TestThread(" one ");
                two = new TestThread(" two ");
                three = new TestThread(" three ");
                one.start();
                two.start();
                three.start();
        }
}





I expected following output:

one
two
three
one
two
three
...




or similar. Under win95 everything went fine.
Unter suse-linux 6.1 with jdk1.1.7 and TYA JIT I got following output:

one
one
one
.
.
.
two
two
two
.
.
.
three
three
three
.
.
.


This did not look like multithreading. It is the same if I use native
threads and not green threads. 
Has anybody an idea how to write   a   real multithread programm under
linux. I have to know it because we wrote a server and we want to run it
under linux and not under windows.

Thanks for our help

Holger


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


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

Reply via email to