Skip to content

Upgrade jython from 2.5.2 to 2.7.4-Unavailibility of _thread package #354

Open

Description

@aayushgupta3

Upgrade jython from 2.5.2 to 2.7.4-Unavailibility of _thread package.

The _threading.class used to have
public static Map<Long, PyObject> _threads = (new MapMaker()).weakValues().makeMap();
public static Map<Thread, PyObject> _jthread_to_pythread = (new MapMaker()).weakKeys().weakValues().makeMap();
public static Map<Long, PyObject> _active = _threads;
public static void _register_thread(Thread jthread, PyObject pythread) {
_threads.put(Long.valueOf(jthread.getId()), pythread);
_jthread_to_pythread.put(jthread, pythread);
}
public static void _unregister_thread(Thread jthread) {
_threads.remove(Long.valueOf(jthread.getId()));
}

and was further used.

We had been using this in our python scripts.
Please share the alternatives for the above in the latest version. Couldn't find their alternatives in the documentations.

Looking forward for a quick response.

Activity

  1. jeff5 commented on Aug 29, 2024

    @jeff5
    Member

    Thanks for exploring 2.7.4. Underscore-anything is always lilkely to be unstable -- a widespread convention, not just in Python. The missing code seemed to exist for the benefit of the Python threading.py library module.

    It looks like this is the change to blame: 41cdc88 (Ten years old next Thursday!)

    In the same change, we see the needs of threading.py met in a different way, so perhaps that gives a model for code you could use in your application?
    41cdc88?diff=unified&w=0#diff-b250d3d0e0d909784a67083e9069ce507513a67e8514a011e2f364027e25e0b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions