aboutsummaryrefslogtreecommitdiff
path: root/core/thread/thread_unix.odin
Commit message (Collapse)AuthorAgeFilesLines
* Replace `core:*` to `base:*` where appropriategingerBill2024-01-281-1/+1
|
* Require parentheses for `#align(N)`gingerBill2023-08-151-1/+1
|
* [core:thread] Seeing if this fixes network testshikari2023-06-071-8/+1
|
* [core:thread] Fix compilationhikari2023-06-071-0/+2
|
* [core:thread] Added `self_cleanup` flag to properly auto-clean threadshikari2023-06-071-0/+5
|
* [thread] Refactor handling of 'init_context' + add doc comments for itTetralux2023-06-031-12/+12
|
* Disable thread.terminate on Darwin for now.Jeroen van Rijn2022-05-111-7/+14
|
* Implement pthread_cancel.Jeroen van Rijn2022-05-111-1/+10
|
* Fix join on *nix.Jeroen van Rijn2022-05-111-5/+14
|
* Replace `sync` with `sync2`gingerBill2022-03-301-1/+1
|
* can use sync.guard hereDale Weiler2022-03-111-2/+1
|
* formattingDale Weiler2022-03-111-2/+2
|
* fix for mac & use atomic store on write side to avoid raceDale Weiler2022-03-111-2/+2
|
* fix for spurious wakeupsDale Weiler2022-03-111-1/+1
|
* fix thread data racesDale Weiler2022-03-111-80/+40
|
* initial OpenBSD supportSébastien Marie2022-02-251-1/+1
|
* Fix mutex and conditions trying to be destroyed twice in unixpowerc90002022-01-271-2/+0
|
* Move thread initialization variables in thread_unix.odingingerBill2021-10-261-2/+6
|
* Add `id` to `thread.Thread`gingerBill2021-10-241-1/+2
|
* Strip semicolons in core which were missinggingerBill2021-09-081-55/+55
|
* Make `or_else` and `or_return` operators (binary and suffix respectively)gingerBill2021-08-151-1/+1
|
* Fix `thread_unix.odin`gingerBill2021-07-051-0/+1
|
* Use `or_else` in the core library when it makes sensegingerBill2021-07-051-7/+1
|
* Revert *nix thread stuff to old syncgingerBill2021-04-131-4/+11
| | | | (I was just testing)
* Remove thread stuff from sync2; Cleanup package threadgingerBill2021-04-111-32/+26
|
* Fix sync.Channel code; add `thread.run_with_poly_data` and ↵gingerBill2020-11-101-2/+3
| | | | `run_with_poly_data(2|3|4)` procedures
* Remove usage of `do` in core librarygingerBill2020-09-231-3/+9
|
* Get Odin compiling and produced exe's running on FreeBSDChristian Seibold2020-09-141-1/+1
|
* Add thread.join_multiplegingerBill2020-07-141-0/+7
|
* Update thread_unix logicgingerBill2020-06-271-6/+14
|
* Fix sync and thread on *nixgingerBill2020-06-221-1/+5
|
* Add `thread.run*` shorthand procedures; `Thread.init_context` use new ↵gingerBill2020-06-221-3/+3
| | | | `Maybe` concept
* Add explicit context to thread_unix.odingingerBill2020-05-141-0/+2
|
* Merge pull request #617 from Tetralux/dep-yield-processorgingerBill2020-04-211-1/+2
|\ | | | | Rename `yield_processor` to `cpu_relax`
| * `sync.yield_processor` -> `sync.cpu_relax`; have it call `intrinsics.cpu_relax`Tetralux2020-04-211-1/+2
| |
* | Remove outdated commentTetralux2020-04-211-9/+0
|/ | | This is what I get for removing the ability to provide a stack at the last minute.... 🤣
* replaced pthread_yield with ssched_yield, fixed semaphore post:qKTRosenberg2020-01-021-1/+1
|
* Fix typogingerBill2020-01-021-1/+1
|
* Add `thread.Pool` with example in demo.odin; Update linalg to support ↵gingerBill2020-01-021-0/+5
| | | | handness changes for projection matrices
* Fix new changes to runtime for unixgingerBill2019-12-311-2/+2
|
* Make default `context.temp_allocator` thread safe when using `package thread`gingerBill2019-12-291-1/+9
|
* whoopsTetralux2019-12-241-3/+0
|
* Fix thread/thread_unix.odin to use the new `switch` conventionsgingerBill2019-12-221-4/+3
|
* Implement core:thread and core:sync on Unix using pthreadsTetralux2019-12-011-0/+153
Also do some cleanup and refactoring of the thread, sync and time APIs. - remove 'semaphore_release' because 'post' and 'wait' is easier to understand - change 'semaphore_wait' to '*_wait_for' to match Condition - pthreads can be given a stack, but doing so requires the user to set up the guard pages manually. BE WARNED. The alignment requirements of the stack are also platform-dependant; it may need to be page size aligned on some systems. Unclear which systems, however. See 'os.get_page_size', and 'mem.make_aligned'. HOWEVER: I was unable to get custom stacks with guard pages working reliably, so while you can do it, the API does not support it. - add 'os.get_page_size', 'mem.make_aligned', and 'mem.new_aligned'. - removed thread return values because windows and linux are not consistent; windows returns 'i32' and pthreads return 'void*'; besides which, if you really wanted to communicate how the thread exited, you probably wouldn't do it with the thread's exit code. - fixed 'thread.is_done' on Windows; it didn't report true immediately after calling 'thread.join'. - moved time related stuff out of 'core:os' to 'core:time'. - add 'mem.align_backward' - fixed default allocator alignment The heap on Windows, and calloc on Linux, both have no facility to request alignment. It's a bit of hack, but the heap_allocator now overallocates; `size + alignment` bytes, and aligns things to at least 2. It does both of these things to ensure that there is at least two bytes before the payload, which it uses to store how much padding it needed to insert in order to fulfil the alignment requested. - make conditions more sane by matching the Windows behaviour. The fact that they were signalled now lingers until a thread tries to wait, causing them to just pass by uninterrupted, without sleeping or locking the underlying mutex, as it would otherwise need to do. This means that a thread no longer has to be waiting in order to be signalled, which avoids timing bugs that causes deadlocks that are hard to debug and fix. See the comment on the `sync.Condition.flag` field. - add thread priority: `thread.create(worker_proc, .High)`