Skip to content

Commit

Permalink
Update TODO items within the code [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Dec 28, 2019
1 parent bd21622 commit a1d862b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 25 deletions.
1 change: 0 additions & 1 deletion weave/channels/event_notifiers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions weave/datatypes/prell_deques.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions weave/datatypes/sync_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions weave/memory/memory_access_patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]]`.

Expand Down
3 changes: 1 addition & 2 deletions weave/memory/memory_pools.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions weave/primitives/barriers_posix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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".}
Expand Down Expand Up @@ -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
## Returns Errno if there is an error
2 changes: 0 additions & 2 deletions weave/scheduler.nim
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,3 @@ proc schedule*(task: sink Task) =
dispatchElseDecline(req)

profile_start(enq_deq_task)

## TODO steal early

0 comments on commit a1d862b

Please sign in to comment.