java threads

ramix

New member
java threads

אני מריץ את הלולאה הבאה
while(true) { Recieve rec=new Recieve(serverPort); rec.recieve(); Analize analizePack=new Analize(rec,rooms,players); analizePack.start(); rec.close(); }​
השורה Analize analizePack=new Analize(rec,rooms,players); היא THREAD. השאלה שלי היא האם כל פעם מיוצר THREAD חדש או שזה בעצם אותו THREAD כי אני נותן לו את אותו שם
 

crake

New member
--->

זהו כל פעם thread חדש , בהנחה שאתה קורא ב constructor של Analize ליצירת thread .
 

ramix

New member
the class constructor

public Analize(Recieve rc, Vector r, Vector p) // constructor // parameters : dat string that contains data { super("tread"+r.capacity()); recievedData=rc; rooms=r; players=p; }​
המחלקה יורשת מ THREAD
 

כאגאי

New member
לא קשור, אתה יוצר

INSTANCE חדש כל פעם אז יווצר לך THREAD חדש בכל פעם. אגב, מה נסגר עם DELETE?
 

כאגאי

New member
על מה אני מדבר?!?! זה JAVA ../images/Emo13.gif

טעות שלי
 
למעלה