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

asyncio/OpenBSD: make concurrent.futures dependency optional #64865

Closed
vstinner opened this issue Feb 17, 2014 · 4 comments
Closed

asyncio/OpenBSD: make concurrent.futures dependency optional #64865

vstinner opened this issue Feb 17, 2014 · 4 comments

Comments

@vstinner
Copy link
Member

BPO 20666
Nosy @gvanrossum, @vstinner
Files
  • synchronous_executor.patch
  • 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-02-18.08:17:21.034>
    created_at = <Date 2014-02-17.23:42:54.807>
    labels = []
    title = 'asyncio/OpenBSD: make concurrent.futures dependency optional'
    updated_at = <Date 2014-02-18.08:17:21.033>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2014-02-18.08:17:21.033>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-02-18.08:17:21.034>
    closer = 'vstinner'
    components = []
    creation = <Date 2014-02-17.23:42:54.807>
    creator = 'vstinner'
    dependencies = []
    files = ['34122']
    hgrepos = []
    issue_num = 20666
    keywords = ['patch']
    message_count = 4.0
    messages = ['211457', '211466', '211472', '211481']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'vstinner', 'rpointel']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue20666'
    versions = []

    @vstinner
    Copy link
    Member Author

    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 bpo-5725 and bpo-10348 to use SysV semaphores. bpo-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).

    @vstinner
    Copy link
    Member Author

    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?

    @gvanrossum
    Copy link
    Member

    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?

    @vstinner
    Copy link
    Member Author

    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.

    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants