Uploaded image for project: 'JikesRVM'
  1. JikesRVM
  2. RVM-54

Switch to Claspath's java.lang.Thread

    Details

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            pdonald 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
            pdonald 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.
            Hide
            ianrogers 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
            ianrogers 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
            pdonald 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
            pdonald 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.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: