| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2021-01-14 | organize std lib concurrency primitives and add RwLock | Andrew Kelley | |
| * move concurrency primitives that always operate on kernel threads to the std.Thread namespace * remove std.SpinLock. Nobody should use this in a non-freestanding environment; the other primitives are always preferable. In freestanding, it will be necessary to put custom spin logic in there, so there are no use cases for a std lib version. * move some std lib files to the top level fields convention * add std.Thread.spinLoopHint * add std.Thread.Condition * add std.Thread.Semaphore * new implementation of std.Thread.Mutex for Windows and non-pthreads Linux * add std.Thread.RwLock Implementations provided by @kprotty | |||
| 2020-12-23 | rework std.ResetEvent, improve std lib Darwin integration | Andrew Kelley | |
| * split std.ResetEvent into: - ResetEvent - requires init() at runtime and it can fail. Also requires deinit(). - StaticResetEvent - can be statically initialized and requires no deinitialization. Initialization cannot fail. * the POSIX sem_t implementation can in fact fail on initialization because it is allowed to be implemented as a file descriptor. * Completely define, clarify, and explain in detail the semantics of these APIs. Remove the `isSet` function. * `ResetEvent.timedWait` returns an enum instead of a possible error. * `ResetEvent.init` takes a pointer to the ResetEvent instead of returning a copy. * On Darwin, `ResetEvent` is implemented using Grand Central Dispatch, which is exposed by libSystem. stage2 changes: * ThreadPool: use a single, pre-initialized `ResetEvent` per worker. * WaitGroup: now requires init() and deinit() and init() can fail. - Add a `reset` function. - Compilation initializes one for the work queue in creation and re-uses it for every update. - Rename `stop` to `finish`. - Simplify the implementation based on the usage pattern. | |||
| 2020-12-23 | apply kprotty's WaitGroup fix | Andrew Kelley | |
| 2020-12-23 | kprotty ThreadPool and WaitGroup patch | Andrew Kelley | |
| 2020-12-20 | update WaitGroup to yet another version | Andrew Kelley | |
| 2020-12-20 | workaround for std lib AutoResetEvent bug | Andrew Kelley | |
| 2020-12-20 | stage2: replace WaitGroup with a trivially auditable one | Andrew Kelley | |
| 2020-12-20 | use kprotty's ThreadPool implementation (v5) | Andrew Kelley | |
