LibretroAdmin
767c898df8
Move every thread onto rthreads and add a lock-free parallel_for
...
No std::thread, std::async, std::future or std::promise is left. Each
thread is an sthread with a plain entry point: Common::ThreadEntry<&C::F>
turns a member function into one, Common::JoinThread joins and clears a
handle, and Common::StartDetachedThread covers the fire-and-forget users.
Common/ParallelFor.{h,c} (C89) runs fn(ctx, i) for i in [0, count) on a
persistent pool of one worker per extra core plus the caller. Jobs are
claimed with an atomic counter, workers park on an eventcount between
batches, and the batch hand-off is a seq_cst users/active pair, so there
is no lock anywhere. A caller that finds the pool busy runs its batch
serially instead of waiting. retro_deinit joins the pool.
- VolumeWii::HashGroup spawned 64 threads per 2 MiB group and
EncryptGroup another one per core; both are now parallel_for batches
on the pool. The H1/H2 tail is a few small hashes and runs inline.
- VolumeVerifier spawned up to five std::async threads per chunk; the
chunk's tasks now go to one persistent worker that fans them out with
parallel_for, still overlapping the next read. The Redump lookup is an
sthread joined in Finish or the destructor.
- The dual-core "GPU thread" in Core only set a thread_local on itself
and exited, since the frontend runs the GPU loop. It is gone, along
with the non-libretro branches of Core.cpp.
- The emu thread is started through Core::StartEmuThread.
- CPU core counts come from cpu_features_get_core_amount().
2026-11-05 13:00:34 +01:00
..
2026-11-05 13:00:34 +01:00
2026-04-17 12:39:46 +02:00
2026-06-25 09:54:48 +01:00
2024-07-26 14:28:34 -07:00
2023-08-12 20:48:47 -07:00
2026-01-25 16:12:15 +01:00
2025-12-24 15:23:25 -06:00
2024-10-10 20:23:55 -07:00
2025-10-26 22:47:23 -05:00
2026-01-25 16:12:15 +01:00
2021-07-05 04:35:56 +02:00
2025-08-18 05:38:14 -07:00
2025-08-18 05:38:14 -07:00
2026-11-05 13:00:22 +01:00
2026-11-05 13:00:22 +01:00
2026-11-05 13:00:34 +01:00
2026-11-05 13:00:34 +01:00
2025-03-09 01:42:45 -06:00
2023-12-09 16:33:21 -05:00
2025-11-20 00:35:01 -06:00
2025-10-31 13:28:14 -05:00
2025-08-23 13:50:22 -05:00
2025-08-23 13:50:22 -05:00
2026-11-05 04:48:00 +01:00
2021-07-05 04:35:56 +02:00
2026-03-22 14:23:46 +01:00
2025-06-24 19:38:45 +01:00
2024-10-12 10:32:41 -07:00
2024-01-03 18:43:44 -06:00
2026-11-05 04:48:00 +01:00
2024-04-04 12:50:34 -07:00
2026-01-25 16:12:15 +01:00
2023-02-15 19:18:39 -08:00
2023-01-25 02:21:56 -06:00
2021-07-05 04:35:56 +02:00
2026-11-05 04:48:00 +01:00
2026-02-22 09:07:47 +00:00
2026-01-25 16:12:15 +01:00
2025-03-26 01:23:16 -05:00
2026-10-23 12:09:05 +02:00
2026-10-23 12:09:05 +02:00
2025-11-11 20:58:35 -05:00
2025-11-15 20:32:10 -06:00
2026-10-16 14:27:05 +01:00
2023-06-19 01:34:42 +03:00
2026-11-05 13:00:34 +01:00
2026-11-05 13:00:34 +01:00
2025-11-11 20:01:52 -06:00
2025-05-12 18:54:42 +02:00
2025-11-12 18:01:53 -06:00
2025-11-12 18:01:53 -06:00
2026-01-25 16:12:15 +01:00
2022-01-13 11:11:08 -08:00
2026-10-16 14:27:05 +01:00
2022-12-29 15:33:19 +01:00
2026-08-07 18:42:52 +12:00
2026-08-02 10:11:15 +02:00
2026-07-15 12:02:16 -07:00
2026-01-25 16:12:15 +01:00
2022-10-22 20:13:24 -05:00
2026-01-25 16:12:15 +01:00
2025-03-22 15:22:00 -05:00
2021-07-05 04:35:56 +02:00
2026-08-07 18:42:52 +12:00
2026-04-17 12:39:46 +02:00
2026-11-05 13:00:19 +01:00
2026-11-05 13:00:19 +01:00
2025-08-23 03:05:04 +01:00
2023-02-09 18:36:20 +13:00
2026-01-25 16:12:15 +01:00
2025-09-13 19:05:33 -05:00
2026-07-29 18:15:38 +02:00
2026-07-13 02:26:49 +02:00
2026-11-05 13:00:22 +01:00
2026-11-05 13:00:22 +01:00
2024-07-26 14:28:34 -07:00
2023-01-31 19:41:24 +13:00
2026-08-07 18:42:52 +12:00
2025-11-23 11:04:24 -06:00
2026-11-05 13:00:19 +01:00
2023-12-22 14:19:26 -05:00
2026-01-25 16:12:15 +01:00
2025-03-22 15:22:00 -05:00
2026-01-17 20:11:38 +01:00
2023-10-05 21:20:16 -05:00
2026-04-24 11:19:11 -07:00
2025-10-26 22:47:23 -05:00
2026-10-28 19:26:30 +01:00
2026-10-28 19:26:30 +01:00
2026-01-17 20:11:38 +01:00
2025-08-23 13:50:22 -05:00
2022-07-15 12:29:40 -07:00
2026-09-24 19:46:18 +02:00
2026-09-24 01:11:11 +02:00
2026-04-17 12:39:46 +02:00
2026-04-17 12:39:46 +02:00
2026-10-16 16:25:04 +01:00
2025-03-22 15:22:00 -05:00
2026-01-25 16:12:15 +01:00
2025-11-02 13:17:28 -05:00
2026-11-05 04:48:00 +01:00
2025-11-02 17:30:43 -06:00
2026-09-24 10:15:25 +01:00
2026-08-31 19:51:30 -05:00
2024-10-10 20:23:55 -07:00
2025-01-20 14:24:54 -06:00
2025-03-09 01:42:45 -06:00
2022-06-16 02:08:45 -05:00
2026-01-25 16:12:15 +01:00
2022-07-16 00:07:10 -07:00
2026-01-25 16:12:15 +01:00
2025-04-23 11:19:20 +02:00
2021-07-05 04:35:56 +02:00
2026-01-25 16:12:15 +01:00
2024-04-20 18:31:08 +02:00
2026-01-19 19:46:21 +01:00
2026-01-19 19:46:21 +01:00
2026-01-24 16:50:10 +01:00
2024-03-21 20:27:34 -05:00
2026-05-03 17:09:59 -07:00
2021-12-10 14:49:57 -08:00
2026-01-09 23:49:10 +01:00
2021-11-17 20:04:33 -08:00
2026-03-21 11:16:15 -04:00
2025-03-22 15:22:00 -05:00
2026-01-25 16:12:15 +01:00
2022-06-16 02:08:45 -05:00
2023-12-02 15:54:52 -08:00
2025-04-23 11:19:20 +02:00
2024-10-12 10:32:41 -07:00
2025-04-23 11:19:20 +02:00
2026-05-03 17:09:59 -07:00
2025-04-23 11:19:20 +02:00
2026-05-03 17:09:59 -07:00
2025-04-23 11:19:20 +02:00
2023-12-02 15:54:52 -08:00
2023-12-02 15:54:52 -08:00
2025-10-14 22:54:58 +01:00
2022-11-22 17:17:11 -08:00
2026-01-25 16:12:15 +01:00
2025-04-23 11:19:20 +02:00
2026-11-05 04:48:00 +01:00
2024-10-12 10:32:41 -07:00
2022-11-22 17:17:11 -08:00
2026-01-25 16:12:15 +01:00
2022-11-22 17:17:11 -08:00
2026-11-05 04:48:00 +01:00
2024-10-12 10:32:41 -07:00
2026-08-07 18:42:52 +12:00
2026-08-07 18:42:52 +12:00
2026-10-16 14:27:05 +01:00
2026-10-16 14:27:05 +01:00
2026-11-05 04:48:00 +01:00
2025-11-16 16:22:40 +00:00
2025-07-21 14:07:26 +09:00
2026-07-05 09:50:13 +02:00
2026-07-05 09:50:13 +02:00
2026-07-05 09:50:13 +02:00
2026-01-25 16:12:15 +01:00
2021-07-05 04:35:56 +02:00
2025-11-06 22:34:40 -06:00
2024-02-20 22:26:19 +02:00
2021-07-05 04:35:56 +02:00
2026-08-07 18:42:52 +12:00
2023-11-26 16:27:26 -06:00
2023-11-26 16:27:26 -06:00
2026-11-05 04:48:00 +01:00
2021-12-18 15:21:36 -08:00