> (Ok, so on older versions, reads from STDIN/STDOUT/STDERR were a problem
> but this has been addressed)
> 


Are you sure ? The following seems to indicate that at least
STDIN will block everything.


import java.io.*;

public class Threads extends Thread
{
    public static void main (String[] av)
    {
        try {
            Threads th = new Threads ();
            th.setDaemon (true);
            th.start ();

            Thread.sleep (5000); /* Is the thread running ? */
            System.out.println ("What's your name ?");
            String strn = (new BufferedReader (
                new InputStreamReader (System.in))).readLine ();

            System.out.println ("Hello, " + strn + "!");
        } catch (Exception e) {
            e.printStackTrace ();
        }
    }

    public void run ()
    {
        try {
            while (true) {
                System.out.println ("Waiting");
                Thread.sleep (500);
            }
        } catch (Exception e) {
            e.printStackTrace ();
        }
    }
}

Reply via email to