Skip to content

Commit cdf2ce3

Browse files
committed
windows sched_yield
1 parent 9f65c78 commit cdf2ce3

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

jsrc/j.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,11 @@ struct jtimespec jmtfclk(void); //'fast clock'; maybe less inaccurate; intended
874874
#endif
875875

876876
#if PYXES
877+
#if _WIN32
878+
#define YIELD Sleep(0); // if we are spinning on other threads, give them a chance to run in case they might be on this core
879+
#else
877880
#define YIELD sched_yield(); // if we are spinning on other threads, give them a chance to run in case they might be on this core
881+
#endif
878882
#define REPATGCLIM 0x100000 // When this many bytes have been repatriated to a thread, call a GC in that thread
879883
#define REPATOLIM (REPATGCLIM/32) // When an outgoing repatriation queue contains this many bytes, flush it
880884
#else

jsrc/mt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
// - Attempt to detect deadlock, perhaps in a debug mode of some sort (cf freebsd kernel WITNESS)
2323

2424
#include"j.h"
25-
#if PYXES
26-
#define YIELD sched_yield(); // if we are spinning on other threads, give them a chance to run in case they might be on this core
27-
#else
28-
#define YIELD ; // if no other processes, no reason to delay
29-
#endif
25+
// #if PYXES
26+
// #define YIELD sched_yield(); // if we are spinning on other threads, give them a chance to run in case they might be on this core
27+
// #else
28+
// #define YIELD ; // if no other processes, no reason to delay
29+
// #endif
3030

3131
// timing shenanigans
3232
struct jtimespec jtmtil(UI ns){ //returns the time ns ns in the future

0 commit comments

Comments
 (0)