diff --git a/weave/channels/event_notifiers.nim b/weave/channels/event_notifiers.nim index b5c9a59..ba57513 100644 --- a/weave/channels/event_notifiers.nim +++ b/weave/channels/event_notifiers.nim @@ -63,7 +63,6 @@ const supportsFutex = defined(linux) or defined(windows) # that do not happen on MacOS. # Instead we use raw futex to replace both locks and condition variables. # They uses 20x less space and do not add useless logic for our use case. -# TODO: Windows futex. Unfortunately BSDs including Mac do not provide a futex. type EventNotifier* = object diff --git a/weave/datatypes/prell_deques.nim b/weave/datatypes/prell_deques.nim index 13809d6..0e1cdd7 100644 --- a/weave/datatypes/prell_deques.nim +++ b/weave/datatypes/prell_deques.nim @@ -19,15 +19,6 @@ type # task has a "fn" field with the proc to run task.fn is proc (param: pointer) {.nimcall.} - # TODO: checkout the liftLocal macro - # to reimplement closures and allow - # - # var myArray: ptr UncheckedArray[int] - # parallel_loop(i, 0, 100000): - # myArray[i] = i - # - # with "myArray" implicitly captured. - PrellDeque*[T: StealableTask] = object ## Private Intrusive Work-Stealing Deque ## from PhD Thesis diff --git a/weave/datatypes/sync_types.nim b/weave/datatypes/sync_types.nim index 16f58c0..320df80 100644 --- a/weave/datatypes/sync_types.nim +++ b/weave/datatypes/sync_types.nim @@ -54,12 +54,9 @@ type # Steal requests # ---------------------------------------------------------------------------------- - # Padding shouldn't be needed as steal requests are used as value types - # and deep-copied between threads StealRequest* = ptr object - # TODO: padding to cache line # TODO: Remove workaround generic atomics bug: https://github.com/nim-lang/Nim/issues/12695 - next*: Atomic[pointer] # For intrusive lists and queues + next*{.align:WV_CacheLinePadding.}: Atomic[pointer] # For intrusive lists and queues thiefAddr*: ptr ChannelSpscSinglePtr[Task] # Channel for sending tasks back to the thief thiefID*: WorkerID retry*: int32 # 0 <= retry <= num_workers diff --git a/weave/memory/memory_access_patterns.md b/weave/memory/memory_access_patterns.md index e4b5bc6..d735adf 100644 --- a/weave/memory/memory_access_patterns.md +++ b/weave/memory/memory_access_patterns.md @@ -187,10 +187,7 @@ In that case, they should have padding so that within the array, fields of 2 con #### Channels for steal requests Multi-Producer Single-Consumer channels with a dynamic but bounded capacity: - - "MaxSteal * number_of_workers" for a spawned thread - - "MaxSteal * number_of_workers * 2" for the master thread - (TODO: the 2x is/was needed when workers sent their state to a manager - thread for termination detection but a Djikstra toen-passing algorithm as been replaced by a dedicated tree algorithm by Dinan et al) + - "MaxSteal * number_of_workers" They serve as a mailbox for steal requests and are stored in a global array `array[MaxWorkers, Channel[StealRequest]]`. diff --git a/weave/memory/memory_pools.nim b/weave/memory/memory_pools.nim index 56069be..a424319 100644 --- a/weave/memory/memory_pools.nim +++ b/weave/memory/memory_pools.nim @@ -493,8 +493,7 @@ proc recycle*[T](p: ptr T) {.gcsafe.} = ## block was returned, the main thread should now ## have ownership of the related arenas and can deallocate them. - # TODO: sink ptr T - parsing bug to raise - # similar to https://github.com/nim-lang/Nim/issues/12091 + # TODO: sink ptr T - parsing bug https://github.com/nim-lang/Nim/issues/12757 preCondition: not p.isNil let p = cast[ptr MemBlock](p) diff --git a/weave/primitives/barriers_posix.nim b/weave/primitives/barriers_posix.nim index d383ac3..8b45e8f 100644 --- a/weave/primitives/barriers_posix.nim +++ b/weave/primitives/barriers_posix.nim @@ -5,8 +5,7 @@ # * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. -# Abstractions over OS-specific barrier implementations -# TODO: support Windows (check iOS, Android, Genode, Haiku, Nintendo Switch) +# Abstractions over POSIX barriers (non-)implementations when not compileOption("threads"): {.error: "This requires --threads:on compilation flag".} @@ -49,4 +48,4 @@ else: ## Wait on `barrier` ## Returns PTHREAD_BARRIER_SERIAL_THREAD for a single arbitrary thread ## Returns 0 for the other - ## Returns Errno if there is an error \ No newline at end of file + ## Returns Errno if there is an error diff --git a/weave/scheduler.nim b/weave/scheduler.nim index 1f68f31..3ee89a6 100644 --- a/weave/scheduler.nim +++ b/weave/scheduler.nim @@ -291,5 +291,3 @@ proc schedule*(task: sink Task) = dispatchElseDecline(req) profile_start(enq_deq_task) - - ## TODO steal early