10 Commits

Author SHA1 Message Date
Andrew Kelley
cf744aa182 std.Io.Threaded: slightly different semantics
while still preserving the guarantee about async() being assigned a unit
of concurrency (or immediately running the task), this change:
* retains the error from calling getCpuCount()
* spawns all threads in detached mode, using WaitGroup to join them
* treats all workers the same regardless of whether they are processing
  concurrent or async tasks. one thread pool does all the work, while
  respecting async and concurrent limits.
2025-11-21 19:54:41 -08:00
Andrew Kelley
5469db66e4 std.Thread.ResetEvent: make it more reusable 2025-10-29 06:20:48 -07:00
Andrew Kelley
ba71079837 combine codegen work queue and linker task queue
these tasks have some shared data dependencies so they cannot be done
simultaneously. Future work should untangle these data dependencies so
that more can be done in parallel.

for now this commit ensures correctness by making linker input parsing
and codegen tasks part of the same queue.
2024-10-23 16:27:39 -07:00
David Rubin
043b1adb8d
remove @fence (#21585)
closes #11650
2024-10-04 22:21:27 +00:00
David Rubin
421fbd939c
thread: don't leak the thread in spawnManager (#21379) 2024-09-11 01:04:59 +00:00
Tristan Ross
6067d39522
std.builtin: make atomic order fields lowercase 2024-03-11 07:09:10 -07:00
Andrew Kelley
3efdfe612e std.Thread.WaitGroup: add spawnManaged
Provides a convenient way to spawn a new thread that bypasses a thread
pool. Appropriate when the spawned thread delegates all of its work.
2024-03-10 17:51:07 -07:00
Andrew Kelley
70931dbdea rework std.atomic
* move std.atomic.Atomic to std.atomic.Value
* fix incorrect argument order passed to testing.expectEqual
* make the functions be a thin wrapper over the atomic builtins and
  stick to the naming conventions.
* remove pointless functions loadUnchecked and storeUnchecked. Instead,
  name the field `raw` instead of `value` (which is redundant with the
  type name).
* simplify the tests by not passing every possible combination. Many
  cases were iterating over every possible combinations but then not
  even using the for loop element value!
* remove the redundant compile errors which are already implemented by
  the language itself.
* remove dead x86 inline assembly. this should be implemented in the
  language if at all.
2023-11-22 19:08:55 -07:00
mlugg
51595d6b75
lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
Andrew Kelley
5b90fa05a4 extract ThreadPool and WaitGroup from compiler to std lib 2023-03-15 10:48:12 -07:00