Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update thread_foobar.h to include timed locking and TLS support #65511

Closed
JackMc mannequin opened this issue Apr 19, 2014 · 9 comments
Closed

Update thread_foobar.h to include timed locking and TLS support #65511

JackMc mannequin opened this issue Apr 19, 2014 · 9 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@JackMc
Copy link
Mannequin

JackMc mannequin commented Apr 19, 2014

BPO 21312
Nosy @tim-one, @pitrou, @JackMc
Files
  • update_thread_foobar.diff
  • update_thread_foobar_v2.diff
  • update_thread_foobar_v3.diff
  • update_thread_foobar_v4.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-04-28.19:13:13.521>
    created_at = <Date 2014-04-19.17:30:33.178>
    labels = ['interpreter-core', 'type-feature']
    title = 'Update thread_foobar.h to include timed locking and TLS support'
    updated_at = <Date 2014-04-28.19:13:13.520>
    user = 'https://github.com/JackMc'

    bugs.python.org fields:

    activity = <Date 2014-04-28.19:13:13.520>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-04-28.19:13:13.521>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2014-04-19.17:30:33.178>
    creator = 'Jack.McCracken'
    dependencies = []
    files = ['34974', '34975', '34976', '34977']
    hgrepos = []
    issue_num = 21312
    keywords = ['patch']
    message_count = 9.0
    messages = ['216867', '216868', '216869', '216870', '216871', '216872', '216873', '217397', '217398']
    nosy_count = 4.0
    nosy_names = ['tim.peters', 'pitrou', 'python-dev', 'Jack.McCracken']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21312'
    versions = ['Python 3.5']

    @JackMc
    Copy link
    Mannequin Author

    JackMc mannequin commented Apr 19, 2014

    The thread_foobar.h reference for the interface for abstracting the platform-specific thread implementation does not include newer features such as timed locking and TLS support.

    @JackMc JackMc mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Apr 19, 2014
    @JackMc
    Copy link
    Mannequin Author

    JackMc mannequin commented Apr 19, 2014

    Missed a word in a comment

    @pitrou
    Copy link
    Member

    pitrou commented Apr 19, 2014

    You may want to provide an implementation of PyThread_acquire_lock() that simply defers to PyThread_acquire_lock_timed() (see thread_pthread.h, which does the same).

    @JackMc
    Copy link
    Mannequin Author

    JackMc mannequin commented Apr 19, 2014

    Added an example of deferring to PyThread_acquire_lock_timed in PyThread_acquire_lock. Also fixed a mistake in the string of a dprintf in PyThread_acquire_lock_timed.

    @pitrou
    Copy link
    Member

    pitrou commented Apr 19, 2014

    Hum, your comment about deferring is wrong, since thread_nt.h also does the deferring:

    int
    PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
    {
        return PyThread_acquire_lock_timed(aLock, waitflag ? -1 : 0, 0);
    }

    @JackMc
    Copy link
    Mannequin Author

    JackMc mannequin commented Apr 19, 2014

    Oops... I removed that and just put the deferral in there.

    @pitrou
    Copy link
    Member

    pitrou commented Apr 19, 2014

    Thanks! The patch looks good to me, I'll let it sleep a bit to see if other people have an opinion.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 28, 2014

    New changeset 7bb1bda5dcef by Antoine Pitrou in branch 'default':
    Issue bpo-21312: Update the thread_foobar.h template file to include newer threading APIs. Patch by Jack McCracken.
    http://hg.python.org/cpython/rev/7bb1bda5dcef

    @pitrou
    Copy link
    Member

    pitrou commented Apr 28, 2014

    Ok, noone chimed in, so I committed the patch :-)
    Thank you very much for your contribution!

    @pitrou pitrou closed this as completed Apr 28, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant