java3d
  1. java3d
  2. JAVA3D-87

Race condition when setting initial wakeup condition

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: 1.3.2-dev
    • Fix Version/s: not determined
    • Component/s: j3d-core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      87
    • Status Whiteboard:
      Hide

      owner-needed

      Show
      owner-needed

      Description

      Behavior.initialize() is called from user thread, as a result of setLive,
      instead of from BehaviorScheduler thread. This leads to a race condition where a
      Behavior could miss having its initial wakeup condition triggered if the wakeup
      condition is satisfied right away. The following test program demonstrates this
      with a call to Behavior.postId that is done immediately following the Behavior
      being added to the scene graph. The Behavior calls wakeupOn(), to wakeup on
      behavior post, from its initialize() method. Occasionally, the post is missed.
      To reproduce this, run the attached program, create the scene graph, and then
      start the test. If you check the "Rotate" option before creating the cube
      (causing it to spin), it will fail more quickly.

        Activity

        Hide
        kcr added a comment -

        Created an attachment (id=46)
        Test program

        Show
        kcr added a comment - Created an attachment (id=46) Test program
        Hide
        kcr added a comment -

        Workaround: wake up using WakeupOnElapsedFrames(0) from initialize(). Move all
        other initialization code from initialize() into processStimulus() and execute
        it the first time processStimulus() is called.

        Show
        kcr added a comment - Workaround: wake up using WakeupOnElapsedFrames(0) from initialize(). Move all other initialization code from initialize() into processStimulus() and execute it the first time processStimulus() is called.
        Hide
        kcr added a comment -

        Updated status

        Show
        kcr added a comment - Updated status
        Hide
        jada added a comment -

        Created an attachment (id=105)
        Added the .form for this test program

        Show
        jada added a comment - Created an attachment (id=105) Added the .form for this test program

          People

          • Assignee:
            java3d-issues
            Reporter:
            kcr
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: