optimized "broadcast and wait" for atomic subroutines

upd4.2
Jens Mönig 2018-02-19 17:32:52 +01:00
rodzic a179cf368d
commit ec46d75aa7
4 zmienionych plików z 26 dodań i 6 usunięć

4
gui.js
Wyświetl plik

@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation, BoxMorph, MediaRecorder*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2018-February-17';
modules.gui = '2018-February-19';
// Declarations
@ -3463,7 +3463,7 @@ IDE_Morph.prototype.aboutSnap = function () {
module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn,
world = this.world();
aboutTxt = 'Snap! 4.1.2\nBuild Your Own Blocks\n\n'
aboutTxt = 'Snap! 4.1.2.1 - dev -\nBuild Your Own Blocks\n\n'
+ 'Copyright \u24B8 2018 Jens M\u00F6nig and '
+ 'Brian Harvey\n'
+ 'jens@moenig.org, bh@cs.berkeley.edu\n\n'

Wyświetl plik

@ -3927,8 +3927,6 @@ Translation Updates:
* Spanish
* Russian
*** in development ***
180206
------
* GUI: start developing v4.1.2
@ -3972,3 +3970,19 @@ Translation Updates:
* new Catalan-Valencia translation
* Catalan
* German
*** in development ***
180217
------
* GUI, snap.html: started v4.1.2.1 development
* Threads: optimized "broadcast and wait" for atomic subroutines
v4.1.2.1 New Features:
Notable Changes:
* optimized "broadcast and wait" for atomic subroutines
Notable Fixes:
Translation Updates:

Wyświetl plik

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Snap! Build Your Own Blocks 4.1.2</title>
<title>Snap! Build Your Own Blocks 4.1.2.1 - dev -</title>
<link rel="shortcut icon" href="favicon.ico">
<script type="text/javascript" src="morphic.js?version=2018-02-17"></script>
<script type="text/javascript" src="widgets.js?version=2018-02-17"></script>

Wyświetl plik

@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
TableFrameMorph, ColorSlotMorph, isSnapObject*/
modules.threads = '2018-February-15';
modules.threads = '2018-February-19';
var ThreadManager;
var Process;
@ -2481,6 +2481,10 @@ Process.prototype.doBroadcast = function (message) {
Process.prototype.doBroadcastAndWait = function (message) {
if (!this.context.activeSends) {
this.context.activeSends = this.doBroadcast(message);
this.context.activeSends.forEach(function (proc) {
// optimize for atomic sub-routines
proc.runStep();
});
}
this.context.activeSends = this.context.activeSends.filter(
function (proc) {
@ -3867,6 +3871,7 @@ Process.prototype.unflash = function () {
startValue initial value for interpolated operations
activeAudio audio buffer for interpolated operations, don't persist
activeNote audio oscillator for interpolated ops, don't persist
activeSends forked processes waiting to be completed
isCustomBlock marker for return ops
emptySlots caches the number of empty slots for reification
tag string or number to optionally identify the Context,
@ -3894,6 +3899,7 @@ function Context(
this.pc = 0;
this.isContinuation = false;
this.startTime = null;
this.activeSends = null;
this.activeAudio = null;
this.activeNote = null;
this.isCustomBlock = false; // marks the end of a custom block's stack