Skip to content

Allow main Dart isolate to be run as the main thread. #19380

Closed

Description

@andersjohnsen

Many UI libraries expect to be run in the main thread. It should either be the default behavior or available behind a flag.

Activity

  1. andersjohnsen commented on Jun 17, 2014

    @andersjohnsen
    Author

    Received the following comment from a user:

      "FYI on win32 it is possible to create Windows on threads other than the main thread if those threads are initialized for COM (CoInitializeEx) with single-threaded apartment (STA). I don't know if there is equivalent functionality on other operating systems."

    This could be done through a native extensions and make the task somewhat more generic: bind a specific thread to an isolate.

    So if we exposed a native API:

      Dart_BindThreadToIsolate();

    this would again be called in a native extension. What do you think, Ivan?

  2. DartBot commented on Jun 29, 2014

    @DartBot

    This comment was originally written by @pjako


    Any developments on this issue?

  3. DartBot commented on Aug 5, 2014

    @DartBot

    This comment was originally written by [email protected]


    Is there any temporary workaround to bind a thread to an isolate ?
    I've tried to come up with a way to make it work using pthread but was unable to the vm isolate key (at least using just dart_api.h).

  4. DartBot commented on Nov 6, 2014

    @DartBot

    This comment was originally written by @pjako


    Started developing a native extension for SDL2. On windows, window creation works fine.

  5. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    and removed on Mar 1, 2016
  6. zanderso commented on Jun 23, 2016

    @zanderso
    Member

    I don't believe there's anything to prevent a thread spawned from a native extension creating an isolate an isolate that takes care of it's own message handling. However we tend to create new embedders when different semantics like this are required. In any case, I don't think we're planning to add the requested feature to the standalone VM.

  7. added
    closed-not-plannedClosed as we don't intend to take action on the reported issue
    on Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.closed-not-plannedClosed as we don't intend to take action on the reported issuetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions