Henrik Rydgård and Claude Opus 5.5
f26ca37dad
Threads: Context switches cost what they do on hardware
...
Timed on a PSP, each way of handing the CPU to another thread (the call
and the switch together):
hardware before now
rotate to an equal thread 7 14 7
signal, better thread runs 10 17 10
it waits again, back to caller 10 19 12
wakeup, better thread runs 8 13 6
it sleeps again, back to caller 7 12 6
start a better thread, entry 30 28 30
thread ends, back to its waiter 21 13 20
notify, better thread's callback 14 13 14
A switch between two threads now costs 1150 cycles instead of 2700.
Starting a better thread costs 2000 cycles more, ending a thread 3300,
and setting up a callback 1800.
Also splits a wait timeout's ~30us into the deadline being taken 12us
into the call and the timeout going off 18us after it. That only changes
the time left written back, which threads/semaphores/wait and
threads/fpl/cancel pin between them. intr/vblank is re-recorded so it
no longer depends on the phase of the frame.
threads/callbacks/combos now passes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com >
2026-09-30 09:06:30 -06:00
..
2026-09-29 09:19:32 -06:00
2026-09-10 17:03:07 -06:00
2026-09-29 17:14:00 -06:00
2026-09-29 17:14:00 -06:00
2026-09-29 17:14:00 -06:00
2026-09-29 17:14:00 -06:00
2025-07-22 17:48:20 +02:00
2026-09-28 16:57:41 -06:00
2026-09-10 17:03:07 -06:00
2026-09-28 11:32:07 -06:00
2026-09-20 16:39:35 -06:00
2026-08-16 16:59:52 +02:00
2026-08-16 16:59:52 +02:00
2026-09-18 16:26:41 -06:00
2026-08-11 10:28:36 +02:00
2026-09-12 13:46:12 -06:00
2026-09-30 09:06:30 -06:00
2025-03-31 11:17:50 +02:00
2026-09-29 12:37:48 -06:00
2026-09-29 12:37:48 -06:00
2026-08-10 10:04:21 +02:00
2025-08-06 17:44:54 +02:00
2026-05-02 11:07:34 +02:00
2025-06-13 23:29:49 +02:00
2026-09-29 12:37:48 -06:00
2026-09-04 13:10:54 -06:00
2026-09-29 11:58:42 -06:00
2026-09-22 16:10:28 -06:00
2026-02-17 09:40:27 +01:00
2026-09-28 11:32:07 -06:00
2025-07-20 19:30:35 +02:00
2025-03-31 11:17:50 +02:00
2026-09-11 21:09:33 -06:00
2026-09-29 17:14:03 -06:00
2025-06-25 11:34:07 +02:00
2026-09-29 09:19:32 -06:00
2026-09-29 09:19:32 -06:00
2026-09-29 17:14:00 -06:00
2026-09-29 17:14:00 -06:00
2025-03-31 11:17:50 +02:00
2025-03-31 11:17:50 +02:00
2026-08-24 17:37:39 +02:00
2026-08-21 10:56:06 +02:00
2026-09-25 12:50:39 -06:00
2025-06-05 22:46:24 +02:00
2026-09-29 12:40:59 -06:00
2026-08-24 10:58:34 +02:00
2026-08-12 14:06:16 +02:00
2026-09-11 21:09:33 -06:00
2026-09-29 09:19:32 -06:00
2026-08-18 13:42:13 +02:00
2026-09-22 16:10:28 -06:00
2026-09-28 11:32:07 -06:00
2026-09-11 21:09:33 -06:00
2025-03-31 11:17:50 +02:00
2025-04-03 22:39:14 +02:00
2026-09-21 16:50:22 -06:00
2026-09-21 16:50:22 -06:00
2026-09-28 09:34:06 -06:00
2026-09-11 21:09:33 -06:00
2026-09-09 14:43:39 -06:00
2026-08-19 18:38:03 +02:00
2026-09-25 12:38:40 -06:00
2025-08-06 00:16:34 +02:00
2026-09-28 11:32:07 -06:00
2026-08-19 18:38:03 +02:00
2026-09-29 11:09:47 -06:00
2026-09-29 11:09:47 -06:00
2026-08-12 14:06:16 +02:00
2026-09-28 11:32:07 -06:00
2026-08-24 10:58:34 +02:00
2026-09-30 09:06:30 -06:00
2026-09-30 09:06:30 -06:00
2026-08-17 16:01:23 +02:00
2026-09-28 09:34:05 -06:00
2026-09-28 09:34:05 -06:00
2026-09-29 09:19:32 -06:00
2026-09-21 13:10:02 -06:00
2026-09-30 09:06:30 -06:00
2026-09-30 09:06:30 -06:00
2026-09-25 10:05:07 -06:00
2026-09-29 11:09:47 -06:00
2026-09-21 14:37:10 -06:00
2026-09-30 09:06:30 -06:00
2026-08-17 16:01:23 +02:00
2026-09-30 09:06:30 -06:00
2026-08-17 16:01:23 +02:00
2026-09-30 09:06:30 -06:00
2026-09-08 11:15:15 -06:00
2026-09-30 09:06:30 -06:00
2026-09-30 09:06:30 -06:00
2026-09-29 09:19:32 -06:00
2026-08-11 22:27:44 +02:00
2026-09-08 15:18:02 -06:00
2026-09-11 21:09:33 -06:00
2026-09-28 11:32:07 -06:00
2025-07-20 19:32:05 +02:00
2025-03-31 11:17:50 +02:00
2026-09-28 11:32:07 -06:00
2026-09-12 11:52:09 -06:00
2026-09-25 16:40:11 -06:00
2026-09-20 16:39:35 -06:00
2026-08-12 14:06:16 +02:00
2026-09-11 21:09:33 -06:00
2026-08-12 14:06:16 +02:00
2026-09-28 11:32:07 -06:00
2026-09-25 12:50:41 -06:00
2026-09-29 12:37:48 -06:00
2026-04-23 11:12:58 +02:00
2026-09-28 09:34:06 -06:00
2025-07-01 19:56:09 +03:00
2026-09-10 15:52:53 -06:00
2026-08-11 20:14:01 +02:00
2025-04-07 22:16:32 +02:00
2026-08-12 14:06:16 +02:00
2026-08-12 14:06:16 +02:00
2025-03-31 11:17:50 +02:00
2026-08-11 10:28:36 +02:00
2026-08-11 10:28:47 +02:00
2026-09-11 21:09:33 -06:00
2026-09-25 12:24:02 -06:00
2026-09-11 21:09:33 -06:00
2026-08-11 10:28:47 +02:00
2026-09-29 09:56:28 -06:00
2026-09-25 16:40:11 -06:00
2026-08-24 09:30:44 +02:00
2025-04-14 22:38:22 +02:00
2026-09-28 11:32:07 -06:00
2026-09-28 11:32:07 -06:00
2026-09-28 11:32:07 -06:00
2025-04-03 14:13:50 +02:00
2026-08-24 12:15:31 +02:00
2026-08-24 11:12:59 +02:00
2026-09-09 14:43:39 -06:00
2026-08-19 18:38:03 +02:00
2026-09-28 09:34:05 -06:00
2026-09-28 09:34:05 -06:00
2025-03-31 11:17:50 +02:00
2026-09-11 21:09:33 -06:00
2025-03-31 11:17:50 +02:00
2026-09-11 21:09:33 -06:00
2025-03-31 11:17:50 +02:00
2026-08-11 20:14:01 +02:00
2026-09-29 09:19:32 -06:00
2026-09-22 10:04:31 -06:00
2026-09-04 18:10:10 -06:00
2025-03-31 11:17:50 +02:00
2026-09-29 12:29:04 -06:00
2026-09-29 12:29:04 -06:00
2026-09-28 11:32:07 -06:00
2026-09-29 11:44:10 -06:00
2026-09-25 12:50:41 -06:00
2026-09-25 12:50:39 -06:00
2026-09-29 11:09:47 -06:00
2026-09-28 16:57:41 -06:00
2026-09-25 17:33:33 -06:00
2026-08-24 10:58:34 +02:00
2026-08-24 10:58:34 +02:00