RVM
  1. RVM
  2. RVM-54

Switch to Claspath's java.lang.Thread

    Details

    • Number of attachments :
      0

      Description

      java.lang.Thread is out-of-date and lacking support for inheritable thread locals, thread groups... If possible we should fit into Classpath and use its java.lang.Thread and VMThread interface.

        Activity

        Peter Donald made changes -
        Field Original Value New Value
        Component/s Runtime: Threads and Concurrency [ 12865 ]
        Peter Donald made changes -
        Fix Version/s 2.9.2 [ 13599 ]
        Fix Version/s 2.9.1 [ 13529 ]
        Hide
        Peter Donald added a comment -

        Rather than doing this as a separate task it was lumped in with the work on the RVM-91 branch. I will extract out and commit in reasonable sized chunks to main trunk.

        Show
        Peter Donald added a comment - Rather than doing this as a separate task it was lumped in with the work on the RVM-91 branch. I will extract out and commit in reasonable sized chunks to main trunk.
        Peter Donald made changes -
        Assignee Ian Rogers [ ianrogers ] Peter Donald [ pdonald ]
        Hide
        Ian Rogers added a comment -

        Hi Peter, whilst doing this change looks quite simple there are a number of subtle fixes in the RVM-91 branch that enable the Classpath java.lang.Thread to work there. I'll list the ones I can remember:

        • Thread.suspend and Thread.resume are synchronized meaning that Thread.suspend must unlock the lock held on itself prior to suspending
          • this leads to problems unwinding the stack as a synchronized method should hold a lock, whereas now we need to explicitly release it
        • the creation of VM threads needs to be modified so that we can use Classpath's rather than our own hooks
          • one particular point of pain is that a java.lang.Thread is created prior to its VM_Thread. The VM_Thread is only created and started by a start happening.
          • another problem is with setting up the java.lang.Thread for the boot thread
            Whilst lumping the work together is far from ideal I wanted to have a good stab at debugging all the changes in the RVM-91 branch together. I've already spent twice the time I'd hope to getting this code into shape.
            Thank you for putting some small changes from the RVM-91 branch into the trunk. I'm not sure if doing the rest of these changes independent of RVM-91 is a good idea. In particular, it seems likely fixes to get this to work will conflict with the hopefully superior way of doing things in the RVM-91 branch.
        Show
        Ian Rogers added a comment - Hi Peter, whilst doing this change looks quite simple there are a number of subtle fixes in the RVM-91 branch that enable the Classpath java.lang.Thread to work there. I'll list the ones I can remember: Thread.suspend and Thread.resume are synchronized meaning that Thread.suspend must unlock the lock held on itself prior to suspending this leads to problems unwinding the stack as a synchronized method should hold a lock, whereas now we need to explicitly release it the creation of VM threads needs to be modified so that we can use Classpath's rather than our own hooks one particular point of pain is that a java.lang.Thread is created prior to its VM_Thread. The VM_Thread is only created and started by a start happening. another problem is with setting up the java.lang.Thread for the boot thread Whilst lumping the work together is far from ideal I wanted to have a good stab at debugging all the changes in the RVM-91 branch together. I've already spent twice the time I'd hope to getting this code into shape. Thank you for putting some small changes from the RVM-91 branch into the trunk. I'm not sure if doing the rest of these changes independent of RVM-91 is a good idea. In particular, it seems likely fixes to get this to work will conflict with the hopefully superior way of doing things in the RVM-91 branch.
        Hide
        Peter Donald added a comment -

        This has been completed as part of RVM-64 and when that merges back into trunk this will be done.

        Show
        Peter Donald added a comment - This has been completed as part of RVM-64 and when that merges back into trunk this will be done.
        Peter Donald made changes -
        Assignee Peter Donald [ pdonald ] Ian Rogers [ ianrogers ]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Ian Rogers
            Reporter:
            Ian Rogers
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: