forked from rebolsource/r3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK! was an unfinished feature of R3-Alpha. The basic idea was that one would be able to do something like a MAKE OBJECT! in which the object's context variables would be isolated to itself... and it would run on an independent thread. Rebol's performance story depended on reuse of several large preallocated global buffers. So the plan had been to use thread-local storage (a feature not standardized until the 2011 C and C++ specs) to mark these global buffers as being instantiated one per thread. So if one of these temporary buffers was used in one thread, it would not trip up another. That work alone was nowhere near the amount of work required to tell a coherent multithreading story. Even at the lowest levels of memory allocation there was no thread safety. If two threads tried to do a memory allocation from the memory pools, they could trip each other up on the internal pointers used for bookkeeping. That's to say nothing of the higher level issues of series management. Regardless of what the long-term multithreading story is for Rebol (and Red), it does not seem fitting to expose users to things like mutexes and semaphores--with the penalty of getting it wrong being a crashing program. Hence there is no acceptable path forward for the stub implementation that was beginning. The practical way to do what TASK! was doing would be to launch independent Rebol processes and exchange information between them (perhaps through something like a ZeroMQ binding). Because modern operating systems only load one copy of the code pages when multiple copies of the same executable are loaded, this would have basically the same overhead as a working TASK! implementation would have had. What is *really* needed to help Rebol in the thread department is to have what the V8 JavaScript engine calls "isolates". This means getting rid of the thread-local-storage concept and instead allowing a single process to hold independent sessions that don't interact with each other directly. This is important in order to have a REPL and debugger that is implemented in Rebol; so that independent interpreter stacks can be running without interfering with each other. The other thing that would be a priority would be to stylize the code in such a way that a garbage collector thread could run concurrently with the evaluator. This is a completely different problem. The tentative strategy for it would lean heavily on C++; hence the pure C build would only be able to use "stop the world" garbage collection.
- Loading branch information
1 parent
dc06920
commit dfcd893
Showing
15 changed files
with
4 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,6 @@ eval proc [ | |
frame?: | ||
module?: | ||
error?: | ||
task?: | ||
port?: | ||
gob?: | ||
event?: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.