-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
_thread: timeout parameter is not implemented in Lock.acquire() #3332
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
Comments
Implementing the timeout parameter requires 2 parts:
Part 2 is the more difficult part. For the unix port the easiest way to do it would be to convert the use of pthread mutexs to semaphores and use sem_timedwait. An alternative to the above is to implement in a naive way a port-independent timeout via a polling loop in |
I would like to avoid that approach as it does give very poor performance which can be difficult to debug if you aren't expecting native sleep functions to busy loop.
Can we create an API for this if one is not already implemented, I would like to consider implementing this on ESP32 using the constructs already available in FreeRTOS. |
I'd suggest to change (at the C level) the existing Would need to choose units for this timeout argument. CPython's |
…x-ulab Shared bindings matrix ulab
To move forward on this I would suggest:
A good start on doing this has been made in #5599 but it needs further work. |
It already implemented on pycom? I have not a pycom board to verify that. |
Question about the Pycom flavor of Micropython are better asked in the Pycom repository of forum. |
MicroPython /ports/cc3200 have WIPY board, their MicroPython implement have big difference? |
The cc3200 WiPy board is the WiPy 1.x. The board is not sold any more since a while. If you have such a board, then you can try yourself whether that is implemented. If you do not have that board, you will most likely not get one. Although some vendors still sell it to people, expecting to get a WiPy 3 board, ESP32 based. |
micropython/py/modthread.c
Line 69 in 62849b7
Background:
I'm looking for a way to implement a cancelable timeout on Linux, e.g something like threading.Timer from the standard library.
Being on Linux, I'm thinking of trying a timerfd with uasyncio instead. But if implementing the timeout parameter here is not too hard, I could give it a try. It looks to be platform dependent though, so it might be beyond my capabilities.
The text was updated successfully, but these errors were encountered: