Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: runtime/vm/thread.h

Issue 1136143003: Remove fake isolate from concurrent sweeper and extend lifetime of VM threads. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.h
===================================================================
--- runtime/vm/thread.h (revision 45808)
+++ runtime/vm/thread.h (working copy)
@@ -17,7 +17,12 @@
// A VM thread; may be executing Dart code or performing helper tasks like
// garbage collection or compilation. The Thread structure associated with
// a thread is allocated when the thread enters an isolate, and destroyed
-// upon exiting an isolate or an explicit call to CleanUp.
+// upon an explicit call to CleanUp.
+//
+// NOTE: When the underlying OS thread is started by the embedder, i.e., not
+// part of a ThreadPool managed by the VM, we currently leak the Thread
+// structure after its last isolate exit. We could add an explicit cleanup API,
+// or, on platforms that support it, register a cleanup callback.
class Thread {
public:
// The currently executing thread, or NULL if not yet initialized.
@@ -27,9 +32,16 @@
// Makes the current thread enter 'isolate'. Also calls EnsureInit.
static void EnterIsolate(Isolate* isolate);
- // Makes the current thread exit its isolate. Also calls CleanUp.
+ // Makes the current thread exit its isolate.
static void ExitIsolate();
+ // A VM thread other than the main mutator thread can enter an isolate as a
+ // "helper" to gain limited concurrent access to the isolate. One example is
+ // SweeperTask (which uses the class table, which is copy-on-write).
+ // TODO(koda): Properly synchronize heap access to expand allowed operations.
+ static void EnterIsolateAsHelper(Isolate* isolate);
+ static void ExitIsolateAsHelper();
+
// Initializes the current thread as a VM thread, if not already done.
static void EnsureInit();
// Clears the state of the current thread.
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698