summary refs log tree commit diff stats
path: root/lib/pure/concurrency
Commit message (Collapse)AuthorAgeFilesLines
* Native access to Genode environmentEmery Hemingway2018-06-071-3/+5
| | | | | | | | | | | | | | | | | Add a 'GenodeEnv' type and a 'componentConstructHook' to the system module. The 'componentConstructHook' allows for detection of POSIX style programs that exit implicitly or native Genode components that initialize to serve RPC requests and OS signals. This hook takes a 'GenodeEnv' argument so that the environment interface is passed cleanly to application code after globals are initialized. This is an typed pointer to a C++ object, procedures for accessing the environment will be available from a Nimble library and not included in the standard library. The standard library has an internal pointer to the environment object but this is not for external use, the undocumented global environment pointer has been removed.
* Minor fixes to enable tccGanesh Viswanathan2018-05-141-1/+1
|
* fixes #7638; awaitAny blocks if the flow vars all have been complete alreadyAndreas Rumpf2018-04-191-7/+17
|
* threadpool: minor documentation improvementAndreas Rumpf2018-04-191-1/+1
|
* Fallback to doNothing if /proc/loadavg cant be opened (#7123)Yuriy Glukhov2018-01-221-11/+14
|
* make tests green againAndreas Rumpf2017-10-291-2/+2
|
* more replacements for the deprecated '<'Andreas Rumpf2017-10-291-2/+2
|
* fixes cpuinfo regressionAraq2017-10-261-8/+2
|
* [Windows] Use GetSystemInfo for obtaining processor count (#6082)Dmitry Atamanov2017-10-251-2/+25
|
* make threadpool care about minPoolSizeAndreas Rumpf2017-10-121-0/+10
|
* Remove expr/stmt (#5857)Arne Döring2017-07-251-4/+4
|
* Revert "GC_fullCollect on sync threadpool (#6107)" (#6119)Yuriy Glukhov2017-07-171-13/+3
| | | This reverts commit bdb653c4156af099814df2e21b9878cdb1591190.
* GC_fullCollect on sync threadpool (#6107)Yuriy Glukhov2017-07-171-3/+13
|
* Fixes #6090 (#6092)Yuriy Glukhov2017-07-141-0/+5
|
* fix countProcessors error return value. (#5942)Parashurama2017-06-051-1/+1
|
* support for the Genode OS framework (#5560)Emery Hemingway2017-03-311-1/+6
|
* Update threadpool.nim (#5624)Tomas Vojtisek2017-03-291-1/+1
|
* Fix overflow when casting int64 to int in cpuload.nimvega2016-12-161-3/+3
|
* Add a lock to prevent race conditionDmitry Polienko2016-08-241-22/+33
|
* Add a workaround for threadpool deadlocks on recursionDmitry Polienko2016-08-111-3/+35
|
* moved random procs from math to its own module (breaking change)Andreas Rumpf2016-05-301-0/+2
|
* Fixed semaphore on iOS.Yuriy Glukhov2016-03-051-14/+16
|
* Fix a few deprecation warningsdef2016-01-251-3/+3
|
* Implement isReady procedure in threadpool module.Dominik Picheta2015-10-121-0/+11
|
* attempt to support recursions for spawnAraq2015-09-061-2/+20
|
* lib: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-1/+1
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* implemented nimPinToCpu threadpool featureAraq2015-08-241-1/+9
|
* Merge branch 'more_concurrency' into develAraq2015-06-301-4/+55
|\ | | | | | | | | | | | | | | Conflicts: doc/tut1.txt lib/core/locks.nim lib/pure/collections/tables.nim lib/pure/selectors.nim
| * proper waiting for the pinned threadAraq2015-06-021-3/+6
| |
| * first implementation of pinnedSpawnAraq2015-05-281-4/+52
| |
* | disabled threadpool assertion only for vccSpencer Stirling2015-06-101-1/+2
| |
* | fixed threadpool and atomics to work with Visual Studio 32 and 64 bitSpencer Stirling2015-06-091-1/+1
| |
* | use new type namesAraq2015-06-061-5/+5
| |
* | lib/pure/a-c - Dropped 'T' from typespdw2015-06-042-5/+5
| |
* | FlowVar's ^ for refs is safe and convenient to useAraq2015-06-021-1/+7
| |
* | fixed typo in threadpool.nimMichael Werner2015-05-081-1/+1
|/
* Don't run non-test code when defined(testing)Oleh Prypin2015-04-211-1/+1
|
* todo updateAraq2015-03-271-1/+1
|
* Happy new year!Guillaume Gelin2015-01-063-3/+3
|
* cleaned up os.nim; docgen improvementsAraq2014-12-211-0/+1
|
* minor improvement to the barrier implementationAraq2014-12-091-1/+3
|
* Fix some deprecation warnings caused by renamesdef2014-11-131-1/+1
|
* renamed CondVar to SemaphoreAraq2014-11-101-26/+26
|
* fixed the deadlock that happens when stress testing ToFreeQueueAraq2014-11-081-25/+30
|
* fixes exhaustion bug and missing GC_ref code generationAraq2014-11-071-5/+4
|
* broken attempt to fix queue exhaustionAraq2014-11-071-21/+29
|
* Merge branch 'devel' into bigbreakAraq2014-10-131-1/+10
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: compiler/ast.nim compiler/nimfix/prettybase.nim compiler/pragmas.nim compiler/sempass2.nim doc/manual.txt koch.nim lib/pure/concurrency/threadpool.nim web/news.txt
| * fixes recent regressionAraq2014-10-111-1/+4
| |
| * minor cleanup for cpuinfoAraq2014-10-111-2/+1
| |
| * fixes #1551Araq2014-10-111-3/+3
| |
lass="nv">node:&:list:_elem <- new {(list _elem): type} *new-node <- put *new-node, value:offset, x next-node:&:list:_elem <- get *in, next:offset *in <- put *in, next:offset, new-node *new-node <- put *new-node, next:offset, next-node ] scenario inserting-into-list [ local-scope list:&:list:num <- push 3, null list <- push 4, list list <- push 5, list run [ list2:&:list:num <- rest list # inside list list2 <- insert 6, list2 # check structure list2 <- copy list 10:num/raw <- first list2 list2 <- rest list2 11:num/raw <- first list2 list2 <- rest list2 12:num/raw <- first list2 list2 <- rest list2 13:num/raw <- first list2 ] memory-should-contain [ 10 <- 5 # scanning next 11 <- 4 12 <- 6 # inserted element 13 <- 3 ] ] scenario inserting-at-end-of-list [ local-scope list:&:list:num <- push 3, null list <- push 4, list list <- push 5, list run [ list2:&:list:num <- rest list # inside list list2 <- rest list2 # now at end of list list2 <- insert 6, list2 # check structure like before list2 <- copy list 10:num/raw <- first list2 list2 <- rest list2 11:num/raw <- first list2 list2 <- rest list2 12:num/raw <- first list2 list2 <- rest list2 13:num/raw <- first list2 ] memory-should-contain [ 10 <- 5 # scanning next 11 <- 4 12 <- 3 13 <- 6 # inserted element ] ] scenario inserting-after-start-of-list [ local-scope list:&:list:num <- push 3, null list <- push 4, list list <- push 5, list run [ list <- insert 6, list # check structure like before list2:&:list:num <- copy list 10:num/raw <- first list2 list2 <- rest list2 11:num/raw <- first list2 list2 <- rest list2 12:num/raw <- first list2 list2 <- rest list2 13:num/raw <- first list2 ] memory-should-contain [ 10 <- 5 # scanning next 11 <- 6 # inserted element 12 <- 4 13 <- 3 ] ] # remove 'x' from its surrounding list 'in' # # Returns null if and only if list is empty. Beware: in that case any other # pointers to the head are now invalid. def remove x:&:list:_elem/contained-in:in, in:&:list:_elem -> in:&:list:_elem [ local-scope load-inputs # if 'x' is null, return return-unless x next-node:&:list:_elem <- rest x # clear next pointer of 'x' *x <- put *x, next:offset, null # if 'x' is at the head of 'in', return the new head at-head?:bool <- equal x, in return-if at-head?, next-node # compute prev-node prev-node:&:list:_elem <- copy in curr:&:list:_elem <- rest prev-node { return-unless curr found?:bool <- equal curr, x break-if found? prev-node <- copy curr curr <- rest curr } # set its next pointer to skip 'x' *prev-node <- put *prev-node, next:offset, next-node ] scenario removing-from-list [ local-scope list:&:list:num <- push 3, null list <- push 4, list list <- push 5, list run [ list2:&:list:num <- rest list # second element list <- remove list2, list 10:bool/raw <- equal list2, null # check structure like before list2 <- copy list 11:num/raw <- first list2 list2 <- rest list2 12:num/raw <- first list2 20:&:list:num/raw <- rest list2 ] memory-should-contain [ 10 <- 0 # remove returned non-null 11 <- 5 # scanning next, skipping deleted element 12 <- 3 20 <- 0 # no more elements ] ] scenario removing-from-start-of-list [ local-scope list:&:list:num <- push 3, null list <- push 4, list list <- push 5, list run [ list <- remove list, list # check structure like before list2:&:list:num <- copy list 10:num/raw <- first list2 list2 <- rest list2 11:num/raw <- first list2 20:&:list:num/raw <- rest list2 ] memory-should-contain [ 10 <- 4 # scanning next, skipping deleted element 11 <- 3 20 <- 0 # no more elements ] ] scenario removing-from-end-of-list [ local-scope list:&:list:num <- push 3, null list <- push 4, list list <- push 5, list run [ # delete last element list2:&:list:num <- rest list list2 <- rest list2 list <- remove list2, list 10:bool/raw <- equal list2, null # check structure like before list2 <- copy list 11:num/raw <- first list2 list2 <- rest list2 12:num/raw <- first list2 20:&:list:num/raw <- rest list2 ] memory-should-contain [ 10 <- 0 # remove returned non-null 11 <- 5 # scanning next, skipping deleted element 12 <- 4 20 <- 0 # no more elements ] ] scenario removing-from-singleton-list [ local-scope list:&:list:num <- push 3, null run [ list <- remove list, list 1:num/raw <- deaddress list ] memory-should-contain [ 1 <- 0 # back to an empty list ] ] # reverse the elements of a list # (contributed by Caleb Couch) def reverse list:&:list:_elem temp:&:list:_elem/contained-in:result -> result:&:list:_elem [ local-scope load-inputs return-unless list, temp object:_elem <- first, list list <- rest list temp <- push object, temp result <- reverse list, temp ] scenario reverse-list [ local-scope list:&:list:num <- push 1, null list <- push 2, list list <- push 3, list run [ stash [list:], list list <- reverse list stash [reversed:], list ] trace-should-contain [ app: list: 3 -> 2 -> 1 app: reversed: 1 -> 2 -> 3 ] ] scenario stash-list [ local-scope list:&:list:num <- push 1, null list <- push 2, list list <- push 3, list run [ stash [list:], list ] trace-should-contain [ app: list: 3 -> 2 -> 1 ] ] def to-text in:&:list:_elem -> result:text [ local-scope load-inputs buf:&:buffer:char <- new-buffer 80 buf <- to-buffer in, buf result <- buffer-to-array buf ] # variant of 'to-text' which stops printing after a few elements (and so is robust to cycles) def to-text-line in:&:list:_elem -> result:text [ local-scope load-inputs buf:&:buffer:char <- new-buffer 80 buf <- to-buffer in, buf, 6 # max elements to display result <- buffer-to-array buf ] def to-buffer in:&:list:_elem, buf:&:buffer:char -> buf:&:buffer:char [ local-scope load-inputs { break-if in buf <- append buf, [[]] return } # append in.value to buf val:_elem <- get *in, value:offset buf <- append buf, val # now prepare next next:&:list:_elem <- rest in nextn:num <- deaddress next return-unless next buf <- append buf, [ -> ] # and recurse remaining:num, optional-input-found?:bool <- next-input { break-if optional-input-found? # unlimited recursion buf <- to-buffer next, buf return } { break-unless remaining # limited recursion remaining <- subtract remaining, 1 buf <- to-buffer next, buf, remaining return } # past recursion depth; insert ellipses and stop append buf, [...] ] scenario stash-empty-list [ local-scope x:&:list:num <- copy null run [ stash x ] trace-should-contain [ app: [] ] ]