summary refs log tree commit diff stats
path: root/lib/system/threads.nim
Commit message (Expand)AuthorAgeFilesLines
...
* Properly register threads with the Boehm GC.Reimer Behrends2015-09-081-15/+46
* make --gc:none work with --threads:onAraq2015-08-261-1/+1
* implemented system.pinToCpuAraq2015-07-011-10/+40
* Fix #2672. Do not define globalsSlot for native TLSSergey Avseyev2015-06-261-16/+11
* Trim trailling spacesSergey Avseyev2015-06-261-36/+35
* Merge branch 'devel' into gogcStefan Talpalaru2015-06-151-67/+73
|\
| * lib/system/g-w - Dropped 'T' from typespdw2015-06-041-67/+73
* | the Go GC - initial implementationStefan Talpalaru2015-05-311-3/+3
|/
* Fix pthread_create binding when compiling in C++ mode.Philip Wernersbach2015-03-151-2/+2
* fixes #2074Araq2015-02-261-1/+11
* Disable -pthread for linker on OSXHans Raaf2015-02-131-1/+3
* proper fix for stack initialization and threadvar emulationAraq2014-11-111-11/+27
* Remove references to pthread_mutex_timedlock().Reimer Behrends2014-11-061-10/+0
* merged things from develAraq2014-09-121-1/+0
|\
| * Threads work againAraq2014-09-111-32/+46
* | make tests greenAraq2014-08-311-23/+37
* | Winlean and threads case sensitivity fixes.Dominik Picheta2014-08-301-4/+4
* | the big renamefest: first stepsAraq2014-08-221-7/+7
|/
* distinguish between 'defined' and 'declared'Araq2014-08-111-6/+6
* minor tweaks; updated todo.txtAraq2014-04-251-1/+1
* made large parts of the stdlib gcsafeAraq2014-04-201-2/+2
* case consistency improvementsAraq2014-01-111-30/+30
* Correct the spelling of the word 'implicitly'Satish BD2013-12-231-1/+1
* better error message for implicitly available modulesAraq2013-12-011-0/+3
* Adds link to manual thread memory section from threads module.Grzegorz Adam Hankiewicz2013-05-101-2/+2
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
* Many doc improvements. Changed Threads.joinThreads' param's type to varargs.Dominik Picheta2012-11-041-1/+1
* made some tests greenAraq2012-09-121-4/+2
* made tests green againAraq2012-08-241-1/+1
* keep initStackBottom calls pleaseAraq2012-08-021-0/+1
* DLL fixes for windows; fixes #175Zahary Karadjov2012-07-311-1/+0
* fixes #168Araq2012-07-191-1/+2
* preparations for making 'closure' the default calling convention for proc typesAraq2012-07-161-2/+2
* year 2012 for most copyright headersAraq2012-01-021-1/+1
* threads compile again; attempt to fix serious code gen issue (except + return)Araq2011-12-031-2/+2
* implemented 'let' statementAraq2011-11-291-1/+2
* fixed bug that kept tls emulation from workingAraq2011-11-251-4/+5
* DLL generation may work againAraq2011-11-021-5/+7
* new compiler option tlsEmulationAraq2011-10-271-1/+1
* bugfixes for generics; new threads implementation still brokenAraq2011-09-201-3/+5
* new actors implementation for nimrod; compiler's generics still not up for th...Araq2011-08-291-64/+30
* locks now in their own core moduleAraq2011-08-201-117/+3
* bugfix: running for threadsAraq2011-08-121-1/+1
* added system.running for threadsAraq2011-08-111-0/+8
* bugfix: proper cache for generic instantiationsAraq2011-07-211-1/+1
* shared untraced heap; bugfix: mem corruptions in message passing codeAraq2011-07-181-9/+4
* first steps to explicit channels for thread communication; added mainThreadIdAraq2011-07-161-2/+10
* version 0.8.12Araq2011-07-101-1/+1
* preparations for 0.8.12Araq2011-07-101-72/+89
* basic message passing workingAraq2011-07-091-8/+29
. ] # click on the code in the sandbox assume-console [ left-click 4, 21 ] run [ event-loop screen:address:shared:screen, console:address:shared:console, 3:address:shared:programming-environment-data 4:character/cursor-icon <- copy 9251/ print screen:address:shared:screen, 4:character/cursor-icon ] # trace now printed and cursor shouldn't have budged screen-should-contain [ . run (F4) . . . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. . stash [abc] 0 x. .] foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊abc . . ┊━━━━━━━━━━━━━━━━━━━. . . ] screen-should-contain-in-color 245/grey, [ . . . . . ┊━━━━━━━━━━━━━━━━━━━. . x. . . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊abc . . ┊━━━━━━━━━━━━━━━━━━━. . . ] # click again on the same region assume-console [ left-click 4, 25 ] run [ event-loop screen:address:shared:screen, console:address:shared:console, 3:address:shared:programming-environment-data print screen:address:shared:screen, 4:character/cursor-icon ] # trace hidden again screen-should-contain [ . run (F4) . . . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. . stash [abc] 0 x. .] foo . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━. . . ] ] scenario sandbox-shows-app-trace-and-result [ trace-until 100/app # trace too long assume-screen 40/width, 10/height # basic recipe 1:address:shared:array:character <- new [ recipe foo [ stash [abc] reply 4 ]] # run it 2:address:shared:array:character <- new [foo] assume-console [ press F4 ] 3:address:shared:programming-environment-data <- new-programming-environment screen:address:shared:screen, 1:address:shared:array:character, 2:address:shared:array:character event-loop screen:address:shared:screen, console:address:shared:console, 3:address:shared:programming-environment-data screen-should-contain [ . run (F4) . . . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. . stash [abc] 0 x. . reply 4 foo . .] 4 . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━. . . ] # click on the code in the sandbox assume-console [ left-click 4, 21 ] run [ event-loop screen:address:shared:screen, console:address:shared:console, 3:address:shared:programming-environment-data ] # trace now printed above result screen-should-contain [ . run (F4) . . . .recipe foo [ ┊━━━━━━━━━━━━━━━━━━━. . stash [abc] 0 x. . reply 4 foo . .] abc . .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4 . . ┊━━━━━━━━━━━━━━━━━━━. . . ] ] container sandbox-data [ trace:address:shared:array:character display-trace?:boolean ] # replaced in a later layer def! update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number -> sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ local-scope load-ingredients data:address:shared:array:character <- get *sandbox, data:offset response:address:address:shared:array:character <- get-address *sandbox, response:offset trace:address:address:shared:array:character <- get-address *sandbox, trace:offset fake-screen:address:address:shared:screen <- get-address *sandbox, screen:offset *response, _, *fake-screen, *trace <- run-interactive data ] # clicks on sandbox code toggle its display-trace? flag after <global-touch> [ # check if it's inside the code of any sandbox { sandbox-left-margin:number <- get *current-sandbox, left:offset click-column:number <- get *t, column:offset on-sandbox-side?:boolean <- greater-or-equal click-column, sandbox-left-margin break-unless on-sandbox-side? first-sandbox:address:shared:sandbox-data <- get *env, sandbox:offset break-unless first-sandbox first-sandbox-begins:number <- get *first-sandbox, starting-row-on-screen:offset click-row:number <- get *t, row:offset below-sandbox-editor?:boolean <- greater-or-equal click-row, first-sandbox-begins break-unless below-sandbox-editor? # identify the sandbox whose code is being clicked on sandbox:address:shared:sandbox-data <- find-click-in-sandbox-code env, click-row break-unless sandbox # toggle its display-trace? property x:address:boolean <- get-address *sandbox, display-trace?:offset *x <- not *x hide-screen screen screen <- render-sandbox-side screen, env, 1/clear screen <- update-cursor screen, recipes, current-sandbox, *sandbox-in-focus?, env # no change in cursor show-screen screen loop +next-event:label } ] def find-click-in-sandbox-code env:address:shared:programming-environment-data, click-row:number -> sandbox:address:shared:sandbox-data [ local-scope load-ingredients # assert click-row >= sandbox.starting-row-on-screen sandbox <- get *env, sandbox:offset start:number <- get *sandbox, starting-row-on-screen:offset clicked-on-sandboxes?:boolean <- greater-or-equal click-row, start assert clicked-on-sandboxes?, [extract-sandbox called on click to sandbox editor] # while click-row < sandbox.next-sandbox.starting-row-on-screen { next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset break-unless next-sandbox next-start:number <- get *next-sandbox, starting-row-on-screen:offset found?:boolean <- lesser-than click-row, next-start break-if found? sandbox <- copy next-sandbox loop } # return sandbox if click is in its code region code-ending-row:number <- get *sandbox, code-ending-row-on-screen:offset click-above-response?:boolean <- lesser-than click-row, code-ending-row start:number <- get *sandbox, starting-row-on-screen:offset click-below-menu?:boolean <- greater-than click-row, start click-on-sandbox-code?:boolean <- and click-above-response?, click-below-menu? { break-if click-on-sandbox-code? return 0/no-click-in-sandbox-output } return sandbox ] # when rendering a sandbox, dump its trace before response/warning if display-trace? property is set after <render-sandbox-results> [ { display-trace?:boolean <- get *sandbox, display-trace?:offset break-unless display-trace? sandbox-trace:address:shared:array:character <- get *sandbox, trace:offset break-unless sandbox-trace # nothing to print; move on row, screen <- render screen, sandbox-trace, left, right, 245/grey, row } <render-sandbox-trace-done> ]