Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4040621

java.io.FileInputStream: Opening a named pipe blocks all threads (green only)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.0.1, 1.1
    • core-libs
    • x86, sparc
    • linux, solaris_2.5.1



      Name: sgC58550 Date: 03/21/97


      Seems that opening a named pipe file blocks all other threads
      in solaris. I run into this problem in a larger System and was
      able to reproduce it with the following code snippet. This is
      a serious bug, the whole process just "hangs" until
      something is sent to the pipe. Run the program with a named
      pipe named "namedpipe" in the current directory (to be created
      with "mkfifo namedpipe").

      Pipetest.java:import java.io.*;
       
      class Pipetest extends Thread
      {
       
          public void run()
          {
              try
              {
                  System.out.println("opening pipe");
                  new FileInputStream("namedpipe");
                  System.out.println("pipe open");
              }
              catch (Exception e)
              {
                  e.printStackTrace();
              }
          }
       
          public static void main(String args[])
          {
              System.out.println("Starting thread which opens a pipe");
              new Pipetest().start();
              System.out.println("Thread started");
              while(true)
              {
                  yield();
                  System.out.println("main thread running");
              }
          }
      }



      company - Union Bank of Switzerland , email - ###@###.###
      ======================================================================

            mr Mark Reinhold
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: