This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncio/OpenBSD: make concurrent.futures dependency optional
Type: Stage:
Components: Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, rpointel, vstinner
Priority: normal Keywords: patch

Created on 2014-02-17 23:42 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
synchronous_executor.patch vstinner, 2014-02-17 23:42 review
Messages (4)
msg211457 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-02-17 23:42
On old FreeBSD versions and on the latest OpenBSD (5.4), the multiprocessing module is not available because POSIX semaphores are not supported by the OS. See issues #5725 and #10348 to use SysV semaphores. #10348 was closed because "implementing SysV semaphores would be a step backwards, plus the API is a real pain" (wrote Charles-François Natali).

Would it be possible to make concurrent.futures dependency optional? In Trollius project (port of asyncio on Python 2), I implemented a very simple synchronous executor used by default as a fallback when concurrent.futures is not available (Trollius uses futures, backport of concurrent.futures for Python 2).

Attached patch is the synchronous executor adapted again on asyncio.

asyncio.executor.Future (when concurrent.futures is missing) is the simplest class and has a different API than concurrent.futures.Future. It is directly created with known result (value or exeption).
msg211466 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-02-18 00:38
Oh, it looks like concurrent.futures and asyncio now works on OpenBSD 5.5:
http://buildbot.python.org/all/builders/x86%20OpenBSD%205.5%203.x/builds/10/steps/test/logs/stdio
(at least tests are running)

OpenBSD 5.5 added support of POSIX semaphores?
msg211472 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2014-02-18 03:12
I'd prefer not to add a bad hack to support such a broken platform. If it doesn't have semaphores, not much Python code will run.

Maybe the dummy_threading module can be used instead?
msg211481 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-02-18 08:17
> I'd prefer not to add a bad hack to support such a broken platform. If it doesn't have semaphores, not much Python code will run.

Oh, in fact concurrent.futures and multiprocessing are available on OpenBSD 5.5 (see the new buildbot created yesterday). test_asyncio is running on this buildbot.

So I suggest to upgrade to OpenBSD 5.5 (currently under development) if you would like to use asyncio.
History
Date User Action Args
2022-04-11 14:57:58adminsetgithub: 64865
2014-02-18 08:17:21vstinnersetstatus: open -> closed
resolution: wont fix
messages: + msg211481
2014-02-18 03:12:43gvanrossumsetmessages: + msg211472
2014-02-18 00:38:41vstinnersetmessages: + msg211466
2014-02-17 23:42:54vstinnercreate