Skip to content

no method for notify(::AsyncCondition)? #39017

@stevengj

Description

@stevengj

Shouldn't we have a notify(::AsyncCondition) method that just calls uv_async_send, so that Julia threads can notify waiting tasks in the main thread? Currently, notify(Base.AsyncCondition()) gives a MethodError.

It seems like AsyncCondition was only designed for use with external libraries, but it seems potentially useful for Julia threads too. Or is there another mechanism preferred for Julia threads to notify waiting tasks?

(I was wondering about this in the context of a discourse thread about how to notify Julia tasks when MPI requests complete. Since MPI_Wait is thread-safe, you could conceivably achieve this by waiting in an OS thread and then notifying waiting tasks with an AsyncCondition.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    multithreadingBase.Threads and related functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions