Big issue with IOCP vs. poll variants is that the overlapped
structures have a longer lifetime than intermediate state needed
for epoll. One cannot free overlapped structures after closing a
handle/socket, like one can do with any intermediate state when using
readiness-based IO.
This results in fewer system calls and presumably more effcient code. It
also brings the epoll (and kqueue) code more in line with how the
windows IOCP code works, incidentally.
Make more use of the built in GC code for abstracts to
be sure things are more correct. Issue before was streams could
be freed before IOCP events arrived.
Instead of setting a flag, each interrupt increments an atomic
counter. When the interrupt is finally handled, either by scheduling
code to run on the event loop or executing some out of band code, the
user must now decrement the interrupt counter with
janet_interpreter_interrupt_handled. While this counter is non-zero, the
event loop will not enter the interpreter. This changes the API a bit but
makes it possible and easy to handle signals without race conditions
or scheduler hacks, as the runtime can ensure that high priority code is
run before re-entering possibly blocking interpreter code again.
Also included is a new function janet_schedule_soon, which prepends to
the task queue instead of appending, allowing interrupt handler to skip
ahead of all other scheduled fibers.
Lastly, also update meson default options to include the
interpreter_interrupt code and raise a runtime error if os/sigaction
is used with interpreter interrupt but that build option is not enabled.
Threaded channels _can_ be marshalled, just not for communication
between threads. This is a special case since the same abstract type
is used for both threaded and non-threaded channels.
commit fbb0711ae1
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 12:07:55 2023 -0500
Distinguish between subprocess when testing.
commit 676b233566
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 11:59:17 2023 -0500
Hack for qemu based testing (also should work with valgrind)
commit d7431c7cdb
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 11:54:04 2023 -0500
Revert "Test removing 32bit ptr marshalling."
This reverts commit 566b45ea44.
commit 566b45ea44
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 11:52:22 2023 -0500
Test removing 32bit ptr marshalling.
commit ff2f71d2bc
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 11:42:10 2023 -0500
Conditionally compile marshal_ptr code.
commit bd420aeb0e
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 11:38:34 2023 -0500
Add range checking to bit-shift code to prevent undefined behavior.
commit b738319f8d
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 11:17:30 2023 -0500
Remove range check on 32 bit arch since it will always pass.
commit 7248626235
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 10:56:45 2023 -0500
Quiet some build warnings.
commit 141c1de946
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 10:50:13 2023 -0500
Add marshal utilities for pointers.
commit c2d77d6720
Merge: 677b8a6fff90b81e
Author: Calvin Rose <calsrose@gmail.com>
Date: Sat Jun 24 10:40:35 2023 -0500
Merge branch 'master' into armtest
commit 677b8a6f32
Author: Ico Doornekamp <ico@zevv.nl>
Date: Mon Jun 12 21:01:26 2023 +0200
Added ARM32 test
When suspended in `ev/give` or `ev/take`, closing the channel should
cause the result of `ev/give` or `ev/take` to be `nil`.
When suspended in `ev/select`, closing the channel should cause the
result of `ev/select` to be `[:close ch]`.
The results were flipped before.
By take and releasing locks twice per channel in the case where nothing
is reading, there was an opportunity for ev/select to hang in the
multithreaded case. Also silence valgrind/helgrind errors.
The sandboxing API is meant to make janet a bit more attractive
for certain application embedding use cases. The sandboxing API
puts limits on what system resources the interpreter can access.