English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

public calss threads implements Runnable
{
public Threads()
{
th1=new Thread (this , "th1");
th1.start();
th2=new Thread(this,"th2");
th2.start();
}
public static void main(sting [] args)
{
threads ths=new Threads();
}
public void run()
{ data ="abc";
}
Thread th1,th2;
String data=new String("data")
}

2006-08-24 21:59:27 · 1 answers · asked by gunsreekanth 1 in Computers & Internet Programming & Design

1 answers

A horribly underspecified program. For starters, you invoke the .start() for 2 threads, but don't give them anything to *do*. And since there's no obvious cross-dependencies (like shared modified data, etc), it;s unclear that the code isn't *already* thread-safe....

2006-08-24 22:19:26 · answer #1 · answered by Valdis K 6 · 0 0

fedest.com, questions and answers