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

(ch) Streams inhibit concurrent reading & writing

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Won't Fix
    • 1.4.0, 1.4.1, 6u20
    • None
    • core-libs
    • generic, x86, sparc
    • generic, solaris_8, windows_nt, windows_2000

    Description

      For tracking purposes :-

      1. java.nio.channels.Channels provides support for interoperation of
      stream classes with channels classes. However there may be concurrency
      as both Channels.newInputStream(sc).read() and
      Channels.newOutputStream(sc).write() synchronize on the blockingLock.
      Thus a thread blocked on read will cause another thread wishing to
      write to block.

      2. As a SocketChannel is a ReadableByteChannel it may be worth
      updating the specification of Channels.newInputStream to indicate
      that the reads on the InputStream do not timeout if
      sc.socket().setSoTimeout() is called to specify a
      timeout (or maybe there should timeout?).

      3. Similiar to item 1 the new SocketAdaptor prohibits concurrent
      reader & writes threads -- eg: thread blocked on
      sc.socket().getInputStream().read() will cause another thread
      to block in sc.socket().getOutputStream().write(). The issue
      gets a more complicated with read timeouts as the channel is
      temporarily put into non-blocking mode to support the timeout.
      Thus if the blockingLock issue is resolved we need to ensure
      that 'write' supports the blocking semantics irrespective of
      the blocking mode of the channel.

      Attachments

        Issue Links

          Activity

            People

              alanb Alan Bateman
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: