aboutsummaryrefslogtreecommitdiff
path: root/src/common/thread.h
Commit message (Collapse)AuthorAgeFilesLines
* [core, gpu, threads] Multithreading refactor (#4254)CamilleLaVey2026-08-081-1/+13
| | | | | | This insufferable work tries to cover some holes on previous threading implementation from yuzu's team, starting with Windows and Linux reordering of priorities (NICE), reworks previous Android's threading and cpu affinity with adpf, adjust emulated clocks/gpu for better "accuracy" with their work, bumps android minSDK for all flavors, legacy will now work with AP 29 to cover A10 - A12, standard will reach A13 as base and finally the optimized build will come with API 35, mostly targeted on devices with A15 support and newer, NDK and AGP wasn't upgraded yet. The performance cost efficiency have been improved based on device power configuration; preventing overheating if certain devices tended to fall into NICE0 (not allocated threads priority, all task ran with higher priority, 11 tasks running within the limited 2 - 7 threads available on the most common configuration 1x3x4 or 1x4x3). Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4254
* [core/core_timing] better MWAITX and WAITPKG delays (#3984)lizzie2026-05-301-10/+4
| | | | | | | | | | | | | This implements MWAITX and WAITPKG extensions (umonitor, mwait) for CPUs that support them. Reduces wait times and bypasses the timing stuff from the OS that is slow (windows notably). generally it should answer within 0.2 to 0.5 microsecs (since most requests wait for that long). Also does a general rework of static ctors and stuff Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3984 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [android, core] pin core threads to logical CPUs 0-3 (#3121)lizzie2026-02-011-2/+2
| | | | | | | | | | | | | | | | this basically allows the threads to exist in these logical CPUs, undisturbed, and without trashing each other's cache this could improve performance, very tricky thing to pull off correctly, but again, this is mostly an experiment will mainly benefit: Linux, Android, FreeBSD, Windows (not ARM) Additionally, this means no context trashing :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3121 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common] use libc++ provided jthread instead of in-house one (which ↵lizzie2025-10-011-1/+4
| | | | | | | | | | | | | | deadlocks on FBSD 14) (#351) Needs test on our CI targets to see I didn't miss anything. Worried about android. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/351 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* general: remove atomic signal and waitLiam2023-06-221-1/+1
|
* general: improve handling of system startup failureLiam2022-12-061-4/+7
|
* Make coretiming waiting more accurateKelebek12022-08-021-0/+4
|
* Core/Common: Corrections to core timing and add critical priority.Fernando Sahmkow2022-06-281-0/+1
|
* chore: add missing SPDX tagsAndrea Pappacoda2022-04-281-3/+3
| | | | Follow-up to 2b87305d319f0bd04da36fb96314934f37b12637
* common: Replace lock_guard with scoped_lockMerry2022-04-071-1/+1
|
* common/thread: Fix data race in is_setReinUsesLisp2020-08-261-4/+5
| | | | | As report by tsan, Event::Set can write is_set while WaitFor and friends are reading from it. To address this issue, make is_set an atomic.
* General: Tune the priority of main emulation threads so they have higher ↵Fernando Sahmkow2020-06-271-0/+9
| | | | priority than less important helper threads.
* Tests: Add base tests to host timingFernando Sahmkow2020-06-181-2/+2
|
* Address second part of review commentsFearlessTobi2020-01-231-1/+1
|
* Input: UDP Client to provide motion and touch controlsfearlessTobi2020-01-231-0/+9
| | | | | | | | An implementation of the cemuhook motion/touch protocol, this adds the ability for users to connect several different devices to citra to send direct motion and touch data to citra. Co-Authored-By: jroweboy <jroweboy@gmail.com>
* general: Use deducation guides for std::lock_guard and std::unique_lockLioncash2019-04-011-5/+5
| | | | | | | Since C++17, the introduction of deduction guides for locking facilities means that we no longer need to hardcode the mutex type into the locks themselves, making it easier to switch mutex types, should it ever be necessary in the future.
* common/thread: Remove unused functionsLioncash2019-03-291-4/+0
| | | | | | | | | | Many of these functions are carried over from Dolphin (where they aren't used anymore). Given these have no use (and we really shouldn't be screwing around with OS-specific thread scheduler handling from the emulator, these can be removed. The function for setting the thread name is left, however, since it can have debugging utility usages.
* common/thread: Make Barrier's 'count' member non-constLioncash2018-11-211-1/+1
| | | | | | | | | | While admirable as a means to ensure immutability, this has the unfortunate downside of making the class non-movable. std::move cannot actually perform a move operation if the provided operand has const data members (std::move acts as an operation to "slide" resources out of an object instance). Given Barrier contains move-only types such as std::mutex, this can lead to confusing error messages if an object ever contained a Barrier instance and said object was attempted to be moved.
* common/thread: Initialize class member variables where applicableLioncash2018-11-211-6/+4
| | | | Simplifies the constructor interfaces for Barrier and Event classes.
* common/thread: Group non-member functions togetherLioncash2018-11-211-3/+2
| | | | | Keeps the non-member interface in one spot instead of split into two places, making it nicer to locate functions.
* common/thread: Remove SleepCurrentThread()Lioncash2018-11-211-1/+0
| | | | | | | This is also unused and superceded by standard functionality. The standard library provides std::this_thread::sleep_for(), which provides a much more flexible interface, as different time units can be used with it.
* common/thread: Remove unused CurrentThreadId()Lioncash2018-11-211-2/+0
| | | | | | This is an old function that's no longer necessary. C++11 introduced proper threading support to the language and a thread ID can be retrieved via std::this_thread::get_id() if it's ever needed.
* common/thread: remove YieldCPU()Weiyi Wang2018-09-221-8/+0
| | | | simply use the standard library yield()
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-5/+5
|
* common/thread: Remove unnecessary feature checking for thread_localLioncash2018-04-191-19/+0
| | | | Every compiler we require already supports it.
* Common::Event: add WaitUntilwwylele2016-12-261-0/+10
|
* Remove empty newlines in #include blocks.Emmanuel Gil Peyrot2016-09-211-1/+0
| | | | | | | This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
* Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner2016-09-181-4/+2
|
* Sources: Run clang-format on everything.Emmanuel Gil Peyrot2016-09-181-18/+22
|
* Thread: Make Barrier reusableMerryMage2016-04-141-5/+5
|
* common/thread: Correct code styleMerryMage2016-04-141-21/+19
|
* Common: Cleanup thread includes.Emmanuel Gil Peyrot2015-06-281-14/+2
|
* Common: Remove common.hYuri Kunde Schlesner2015-05-071-1/+0
|
* Common: thread.h cleanupsYuri Kunde Schlesner2015-04-161-65/+16
| | | | | The helper classes are rendered obsolete by C++11 lambdas. Also made formatting conform to our code style.
* Add profiling infrastructure and widgetYuri Kunde Schlesner2015-03-011-0/+19
|
* License changepurpasmart962014-12-201-2/+2
|
* New logging systemYuri Kunde Schlesner2014-12-131-0/+1
|
* Remove trailing spaces in every file but the ones imported from SkyEye, AOSP ↵Emmanuel Gil Peyrot2014-11-191-4/+4
| | | | or generated
* Remove extraneous semicolonsLioncash2014-11-181-1/+1
|
* Removed common/std_xyz, instead using the std headerarchshift2014-09-071-4/+3
|
* Common: Move remaining C header includes over to their C++ equivalentLioncash2014-08-171-2/+2
|
* Common: Move header guards over to pragma onceLioncash2014-08-171-4/+1
| | | | Also replaced C headers with the C++ equivalent ones
* fixed project includes to use new directory structurebunnei2014-04-081-4/+4
|
* got rid of 'src' folders in each sub-projectbunnei2014-04-081-0/+156