Calvin Rose
92e91259c3
Don't call pthread cancel on normal exits.
...
Calling pthread_cancel on threads that can exit normally is not needed.
Instead, we immediately call pthread_join if a thread can exit normally.
2025-05-18 09:52:11 -05:00
Calvin Rose
e355cb07e0
Reorder declarations.
2025-05-18 09:27:01 -05:00
Calvin Rose
5bbfcdacd5
Work on #1596 - No detached threads, make sure to call pthread_join
...
Call pthread_join on all worker threads for timeouts. Previously, we
were leaking some threads, as well as creating a timeout and leaving
has_worker unset on certain timeouts.
2025-05-18 08:36:53 -05:00
Calvin Rose
790a4f2636
Make tests pass with clang sanitizers.
...
Fix some issue with clang sanitizers, name -fsanitize=thread and
-fsanitize=undefined. The threading issue arose from the implementation
of ev/deadlock when allowing for interpreter intrerrupts, as this is
implemented by racing a timeout thread with a worker thread.
The undefined behavior issue arose in some very old code in corelib.c that will
actually work as expected for most compilers, but was both undefined and
unecessary as we have a correct implemenation in util.c.
2025-05-17 21:28:41 -05:00
Calvin Rose
4643c8fa35
Squashed commit of the following:
...
commit c5b3da1ffe
Author: Calvin Rose <calsrose@gmail.com >
Date: Fri May 16 18:35:33 2025 -0500
Inter
2025-05-16 18:49:45 -05:00
Calvin Rose
a8e2c8e5b8
Address #1596 - Use atomic intrinsics to check allow_interrupt flag.
...
Use a relaxed memory order if possible to mitigate performance issues as
much as possible. relaxed memory order should be sufficient.
2025-05-16 18:26:43 -05:00
Calvin Rose
bef8ba5e06
Merge pull request #1594 from sogaiu/tweak-docstrings
...
Tweak docstrings for better handling
2025-05-08 17:00:32 -05:00
Calvin Rose
c3317905a1
Move sysir C lowering to separate file
2025-05-07 07:25:05 -05:00
Calvin Rose
0066a5a304
Start removing NASM dependence.
...
Start setting up a test suite for sysir and work towards emitting jitted
x86 machine code.
2025-05-04 20:20:11 -05:00
sogaiu
4b6d5e5671
Tweak docstrings for better handling
2025-05-02 18:54:18 +09:00
Agent Kilo
a695454dae
Try to fix cfun registry size check for cross-thread messages
2025-04-28 17:00:23 +08:00
Calvin Rose
f2eaa5dee8
Remove ev/to-stream.
...
The function has more problems than initially expected, both on Posix
systems and on Windows. Given all the caveats, it is probably best not
to include. Any function that can obtain files can use os/open instead.
The standard FILE objects also will not work anyway, and different
operating systems have different work arounds.
2025-04-18 18:20:27 -07:00
Calvin Rose
3dd6e744de
More work on e_mov - work on loading immediates.
2025-04-15 20:40:05 -05:00
Calvin Rose
862b4e9688
Add sysir test suite stub
2025-04-13 07:47:52 -05:00
Calvin Rose
c9305a0a42
Format.
2025-04-11 22:44:36 -05:00
Calvin Rose
3cbdf26aa2
Merge branch 'master' into compile-opt
2025-04-11 22:44:28 -05:00
Calvin Rose
b27c830d90
Use win32 DuplicatHandle instead of _dup
...
There are constraints when using the posix API on win32
that aren't present with normal win32.
2025-04-11 21:36:08 -05:00
Calvin Rose
92a852f2df
Add ev/to-stream.
...
This function is symmetrical to ev/to-file and can convert a blocking
file to a stream (with caveats).
2025-04-11 21:10:49 -05:00
Calvin Rose
647e218bed
make format
2025-04-09 20:39:23 -05:00
Michael Camilleri
5705b2f6c7
Fix absence of pthread_cancel in Android
2025-04-09 10:37:46 +09:00
Calvin Rose
90a33bc88a
Add some systems that support addchdir.
2025-04-07 21:12:28 -05:00
Calvin Rose
1ba077c87d
Add ifdefs for various platforms to check for the support of addchdir.
...
This will need to be expanded but should support most modern systems.
2025-04-07 21:12:28 -05:00
Calvin Rose
34629ae314
Fix signature on windows.
2025-04-07 21:12:28 -05:00
Calvin Rose
3edc4f35b2
Add :cd argument to os/execute and os/spawn.
2025-04-07 21:12:28 -05:00
Calvin Rose
e8187fdee5
Fix windows build
2025-04-05 20:26:57 -05:00
Calvin Rose
2fedb67cb3
formatting
2025-04-05 17:32:07 -05:00
Calvin Rose
bdab93c999
Add {:err :out} option to os/spawn.
...
This special case in the os/spawn interface allows easily
redirecting both stderr and stdout to the same pipe.
2025-04-05 17:30:46 -05:00
Calvin Rose
a9ff8b388f
Add os/getpid
2025-04-05 16:20:17 -05:00
Calvin Rose
11e6a5a315
More work on compile-opt.
2025-03-31 21:48:46 -05:00
Calvin Rose
871f8ebf4e
More work on moving to machine code emission.
2025-03-30 13:38:33 -05:00
Calvin Rose
c677c72a73
Add tool that lets us more easily compare compilation paths.
...
Compare:
IR -> C -> x64
vs.
IR -> x64
2025-03-29 20:37:51 -05:00
Calvin Rose
af73e214b2
Begin work on emitting machine code directly.
...
Far from done, we are currently splicing raw bytes in NASM output.
2025-03-29 16:52:11 -05:00
Calvin Rose
a6e0a8228c
Merge branch 'master' into compile-opt
2025-03-28 16:24:27 -05:00
Calvin Rose
b458404b41
Update ffi/write to append to a buffer by default.
2025-03-28 10:00:40 -05:00
Michael Camilleri
eac37ab869
Avoid leaking memory used for JanetThreadedTimeout struct
2025-03-25 22:02:53 +09:00
Michael Camilleri
a24e5b1eaa
Prevent deadline timeout being less than zero
2025-03-25 21:41:59 +09:00
Michael Camilleri
09ac85b1b9
Move janet_timeout_* function definitions before first use
2025-03-25 21:15:28 +09:00
Michael Camilleri
87c1eab7d4
Define JanetTimeout only if event loop enabled
2025-03-25 21:14:21 +09:00
Michael Camilleri
5a29a28c11
Include <windows.h> in state.h
2025-03-25 20:34:45 +09:00
Michael Camilleri
2ed186664f
Support using a background thread to monitor deadlines
2025-03-25 20:27:44 +09:00
Calvin Rose
73334f3485
Prepare for 1.38.0 release.
2025-03-18 21:14:45 -05:00
Benjamin Roberts
e8cccfced5
Remove janet_lib_ffi() dependency on JANET_EV
2025-03-18 10:54:18 -04:00
sogaiu
18c00e89da
Fix vm bugs from #1566
2025-03-13 11:43:43 +09:00
Calvin Rose
9538b8a77c
Merge pull request #1562 from pyrmont/bugfix.subprocess-cleanup
...
Improve subprocess-related docstrings and functions
2025-03-03 18:47:59 -08:00
Michael Camilleri
4b5a2a14c0
Update year in copyright disclaimer to 2025
2025-03-04 11:24:09 +09:00
Michael Camilleri
8f8b6ed001
Remove note on cancellation and tidy up wording
2025-03-03 23:28:37 +09:00
Calvin Rose
e0a0e2ed42
Prevent multi-scheduling with os/proc-wait. (address #1562 )
2025-03-02 10:44:15 -06:00
Michael Camilleri
39f5c539d7
Clarify wording of docstrings further
2025-03-02 13:25:14 +09:00
Michael Camilleri
1b6437a4f8
Remove unnecessary returns
2025-03-02 08:30:51 +09:00
Michael Camilleri
c62c1a58f0
Reword documentation relating to subprocess creation
2025-03-02 08:29:32 +09:00