classification
Title: thread_PyThread_start_new_thread fails with a generic error
Type: enhancement Stage: patch review
Components: Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, kristjan.jonsson, pitrou
Priority: normal Keywords: patch

Created on 2012-09-23 08:34 by kristjan.jonsson, last changed 2020-09-02 16:54 by ZackerySpytz.

Pull Requests
URL Status Linked Edit
PR 22068 open ZackerySpytz, 2020-09-02 16:54
Messages (2)
msg171017 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2012-09-23 08:34
If thread creation fails, for any reason, a ThreadError is returned with the error "can't start new thread".
No attempt is made to diagnose the issue.
In fact, for example, if we are out of resources, pthread_new() would have returned EAGAIN.  This should perhaps rather be classified as an OSError so that users can catch this and diagnose it.  ThreadError seems to be used otherwise exclusively to indicate problems with locking.

Can this be turned into an informative OSError, or is it to platform dependant for any sensible structured error handlng to be implemented?
msg171045 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-09-23 15:35
I'm personally ok with using a more informative error than ThreadError.
History
Date User Action Args
2020-09-02 16:54:01ZackerySpytzsetkeywords: + patch
nosy: + ZackerySpytz

pull_requests: + pull_request21158
stage: patch review
2012-09-23 15:35:48pitrousetnosy: + pitrou
messages: + msg171045
2012-09-23 08:34:06kristjan.jonssoncreate