You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow main Dart isolate to be run as the main thread. #19380
"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?
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).
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.
Activity
andersjohnsen commentedon Jun 17, 2014
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?
DartBot commentedon Jun 29, 2014
This comment was originally written by @pjako
Any developments on this issue?
DartBot commentedon Aug 5, 2014
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).
DartBot commentedon Nov 6, 2014
This comment was originally written by @pjako
Started developing a native extension for SDL2. On windows, window creation works fine.
zanderso commentedon Jun 23, 2016
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.