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

WaitForMultipleObjects features in java.util.concurrent

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • None
    • 6
    • core-libs

    Description

      A DESCRIPTION OF THE REQUEST :
      Sometimes, we need a features where a single thread is trying to wait for multiple lock. If ONE of the lock is being signaled, the thread will be released from wait state.


      JUSTIFICATION :
      Consider the following senario

      1. Thread A is waiting Lock A forever. Lock A will be in local scope.
      2. Thread STOP trying to released Thread A from wait state. If Thread STOP doesn't have access to Lock A, there are no way to release Thread A

      If we can have something :

      1. Thread A is waiting for Lock A and Member_Variable_Lock forever.
      2. Thread STOP trying to released Thread A from wait state. Although Thread STOP doesn't have access to Lock A, STOP does access to Member_Variable_Lock.
      3. Thread STOP signaled Member_Variable_Lock.
      4. Thread A realize Member_Variable_Lock is being signaled. Thread A will be relased from wait state.

      WaitForMultipleObjects is standard Windows API. (Waits until one or all of the specified objects are in the signaled state or the time-out interval elapses.) Please refer to the following documentation for more detail:

      http://msdn2.microsoft.com/en-us/library/ms687025.aspx

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A feature, where "A thread able to Wait until one or all of the specified objects are in the signaled state or the time-out interval elapses"
      ACTUAL -
      A thread can only wait for a single object.

      CUSTOMER SUBMITTED WORKAROUND :
      Design code so that the lock can be accessed by STOP thread.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Imported:
              Indexed: