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

Deadlock in ObjectStream when both sides call getInputStream()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs

      Name: mc57594 Date: 01/13/2000


      When writing client-server program and both client and server
      want to make an ObjectInputStream, a deadlock can be occured.

      When both sides issue the command
      ObjectInputStream oin = new ObjectInputStream(socket.getInputStream());
      before any of them get the ObjectOutputStream, a deadlock will happen.

      It means that if both sides want to get both the ObjectInputStream
      and ObjectOutputStream, either one or both of them have to get
      the ObjectOutputStream first. If both of them have the same sequence
      of getting InputStream before getting OutputStrem, both sides will
      be halted

      =======================
      Date: Fri, 19 Nov 1999 16:35:46 +0800 (HKT)
      From: Chow Calvin <###@###.###>
      X-Sender: chow@uststf2
      To: chamness <###@###.###>
      Subject: Re: (Review ID: 96887) Deadlock in ObjectStream when both sides call getInputStream()


      Hi Mark,

      I noticed the program halted since the printout stop somewhere in
      between as in the case I described before. I run the result under
      PII-400MHz PC running Red Hat Linux release 6.0 (Hedwig). The following is
      what I got from java -version

      java version "1.2"
      Classic VM (build Linux_JDK_1.2_pre-release-v2, native threads, sunwjit)

      Regards,
      Calvin
      (Review ID: 96887)
      ======================================================================

      This is an old blackdown release, we should verify it though

            nsanjeevsunw Naveen Sanjeeva (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: