1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00
Commit Graph

168 Commits

Author SHA1 Message Date
RipleyTom
10820fa135
Implement sceNpSignaling & signaling improvements (#8836) 2020-09-07 22:50:17 +01:00
Eladash
a029a94c73 SPU: Use waitable atomics for SPU channels interface 2020-07-23 13:45:58 +03:00
Nekotekina
f6200ba635 Implement thread_ctrl::get_process_affinity_mask() 2020-05-01 22:00:56 +03:00
Nekotekina
76294beae1 Implement thread_ctrl::get_thread_affinity_mask() 2020-04-29 00:09:40 +03:00
Nekotekina
aae338a91c named_thread_group: add a default constructor 2020-03-28 17:17:51 +03:00
Nekotekina
49d8731c1c Thread.h: fix warning 2020-03-21 13:49:41 +03:00
Nekotekina
c577bd2111 Implement thread_state::errored
State after calling thread emergency_exit() function.
Also default-construct thread result in this case.
2020-03-20 21:31:27 +03:00
Nekotekina
04dedb17eb Disable exception handling.
Use -fno-exceptions in cmake.
On MSVC, enable _HAS_EXCEPTION=0.
Cleanup throw/catch from the source.
Create yaml.cpp enclave because it needs exception to work.
Disable thread_local optimizations in logs.cpp (TODO).
Implement cpu_counter for cpu_threads (moved globals).
2020-03-12 16:03:08 +03:00
Nekotekina
07e1766a7c Implement thread_ctrl::emergency_exit()
Replace exception throws with this.
2020-03-08 15:11:02 +03:00
Nekotekina
8d847d6f1c Thread: internal cleanup
Use different, simpler algorithm in wait_for.
Although the very idea of such notifications was rotten.
2020-03-03 20:26:37 +03:00
Nekotekina
d594490329 Thread: removed unused wait() with predicate.
It doesn't work this way anyway.
2020-03-03 18:33:02 +03:00
Nekotekina
6c66153372 Threads: move linux m_timer to static thread_local variable
Allows lazy allocation of the timer handle.
2020-03-03 18:33:02 +03:00
Nekotekina
f72971f19f Implement named_thread_group 2020-02-29 16:55:25 +03:00
Nekotekina
799c3f9708 Remove global thread counter (again)
Seems fine without it now.
2020-02-28 21:50:19 +03:00
Nekotekina
490f58ff3c Try to purge thread_state::detached
It's rarely necessary, but can cause unexpected problems.
2020-02-28 21:11:13 +03:00
Nekotekina
65eeee0f4c Remove cancerous lf_value<>
Replace thread names (generic, PPU, SPU) with new shared pointers.
Devirtualize cpu_thread::get_name (used in single case).
2020-02-28 18:54:46 +03:00
Nekotekina
a0d2bc9769 named_thread: allow default constructor only with thread_name
In C++20, lambdas may be default-constructible allowing nasty stuff.
2020-02-26 21:23:30 +03:00
Nekotekina
b083edccd3 Threads: remove some unused code (remnants from thread spawn) 2020-02-25 15:57:57 +03:00
Nekotekina
b59bb16fad Threads: removed outdated on_abort detection deemed unnecessary
May cause regressions.
2020-02-25 15:48:25 +03:00
Nekotekina
3f943945a7 Threads: Remove unused on_wait() detection to simplify code 2020-02-25 15:36:08 +03:00
Nekotekina
7eebe06931 Restore thread counter (world may be not ready yet)
Remove dumb 1300ms timeout.
2020-02-25 11:51:19 +03:00
Nekotekina
8b4b859091 Remove "thread_ctrl::spawn" 2020-02-23 15:03:38 +03:00
Nekotekina
6a443c0fbd Deprecate thread_ctrl::spawn 2019-10-12 19:14:50 +03:00
plappermaul
925f2ce02f Use Linux timers for sleeps up to 1ms (#6697)
* Use Linux timers for sleeps up to 1ms (v3)
The current sleep timer implementation basically offers two variants. Either
wait the specified time exactly with a condition variable (as host) or use a
combination of it with a thread yielding busy loop afterwards (usleep timer).

While the second one is very precise it consumes CPU loops for each wait call
below 50us. Games like Bomberman Ultra spam 30us waits and the emulator hogs
low power CPUs. Switching to host mode reduces CPU consumption but gives a
~50us penalty for each wait call. Thus extending all sleeps by a factor of
more than two.

The following bugfix tries to improve the system timer for Linux by using
Linux native timers for small wait calls below 1ms. This has two effects.

- Host wait setting has much less wait overhead
- usleep wait setting produces lower CPU overhead
2019-10-09 20:03:34 +03:00
Nekotekina
8031180373 Add dummy alert param to thread_ctrl::wait API 2019-10-06 16:03:10 +03:00
Nekotekina
50fc5dfde5 Use g_fxo for rsx::rsx_replay_thread 2019-09-26 23:26:36 +03:00
Nekotekina
75941e62a8 named_thread: implement default thread name support 2019-09-17 02:46:34 +03:00
Nekotekina
c1b0934f72 Simplify thread_base::join()
Use waitable atomics
2019-09-10 19:25:39 +03:00
Nekotekina
d13ff285d1 Rewrite cond_variable to use waitable atomics
Increase max_timeout and fix max_timeout usage
2019-09-10 19:25:39 +03:00
Nekotekina
faba366f89 named_thread: install atomic wait callback 2019-09-10 18:48:46 +03:00
Nekotekina
f63e89f9b4 Implement waitable atomics
Moved Atomic.h to util/atomic.hpp
List source files in CMakeLists.txt
2019-07-29 03:04:55 +03:00
Nekotekina
4e4c896136 Expand thread affinity mask to u64
Also fix and note __APPLE__ path.
2019-07-20 15:58:28 +03:00
Nekotekina
1b37e775be Migration to named_thread<>
Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
2018-10-19 22:22:35 +03:00
Nekotekina
4bef0f8dab Rename thread_abort (name conflict) 2018-10-02 23:26:54 +03:00
Nekotekina
3359e9a51b Minor thread fixes
Call thread result destructor
2018-10-02 02:22:26 +03:00
Nekotekina
306f95a9ae New named_thread template (preview)
Old class named_thread renamed to old_thread
It's too hard to move in a single commit
2018-09-27 14:04:16 +03:00
Nekotekina
a605dd0a3f Add missing deleted operators 2018-09-27 12:16:43 +03:00
Nekotekina
c5676e5649 Remove thread_ctrl::atexit
It was only a workaround for poor C++11 thread_local support
2018-09-15 17:09:56 +03:00
Nekotekina
99ffc3fca9 Use std::invoke_result_t
Also simplify idm code
2018-09-08 00:32:04 +03:00
VelocityRa
8981227644 util/thread_ctrl: Method for measuring cycles a thread has run for
Also add a getter for the native thread handle.
2018-05-30 12:35:41 +03:00
kd-11
cbc8bf01a1 cell/scheduler: Manage thread placement depending on cpu hardware 2018-01-19 12:03:57 +03:00
Nekotekina
7d3a528871 Use Qt for error reports 2017-11-23 20:36:21 +03:00
Nekotekina
6561ddae41 PPU LLVM: multithread compilation 2017-06-24 19:12:19 +03:00
kd-11
df7b466656 spu: Speed hacks - Do not starve PPU threads
optionally hint to the OS scheduler to give less attention to SPUs

ui: Add speed 'hacks' as configurable options
2017-05-10 21:50:14 +03:00
Nekotekina
436c245d13 Remove unused code 2017-02-13 18:33:31 +03:00
Nekotekina
a5a2d43d7c Thread.cpp refinement
Hide thread mutex
Safe notify() method
Other refactoring
2017-01-29 19:52:19 +03:00
Nekotekina
0f87c4485d Silly macro removed-2 2016-08-14 18:19:42 +03:00
Nekotekina
f8719c1230 PPUThread refactoring
`CallbackManager` removed, added _gcm_intr_thread for cellGcmSys
`PPUThread` renamed to `ppu_thread`, inheritance allowed
Added lightweight command queue for `ppu_thread`
Implemented call stack dump for PPU
`get_current_thread_mutex` removed
`thread_ctrl::spawn`: minor initialization fix
`thread_ctrl::wait_for` added
`named_thread`: some methods added
`cpu_thread::run` added
Some bugs fixes, including SPU channels
2016-07-30 16:35:02 +03:00
Nekotekina
a026d35c97 sys_interrupt_thread_eoi fixed
thread_ctrl::interrupt improved
BIND_FUNC improved: preparations
2016-07-24 21:06:07 +03:00
Nekotekina
7ccdea7822 Removed std::enable_shared_from_this
Minor ID manager refactoring
2016-07-24 21:06:05 +03:00
Nekotekina
59433bfcd5 Implemented thread_ctrl::interrupt 2016-07-17 02:23:45 +03:00
Nekotekina
266db1336d The rest 2016-05-23 16:22:25 +03:00
Ivan
da7472fe81 Optimizations (#1680)
* Optimizations

1) Some headers simplified for better compilation time
2) Some templates simplified for smaller executable size
3) Eliminate std::future to fix compilation for mingw64
4) PKG installation can be cancelled now
5) cellGame fixes
6) XAudio2 fix for mingw64
7) PPUInterpreter bug fixed (Clang)

* any_pod<> implemented

Aliases: any16, any32, any64
rsx::make_command fixed
2016-04-25 13:49:12 +03:00
Nekotekina
250ce63527 Partial commit: Utilities 2016-04-15 19:22:20 +03:00
Nekotekina
a666318b95 Error messages improved 2015-12-20 15:41:09 +03:00
Nekotekina
ca6783ba9a Threads improved, ID manager improved 2015-12-04 23:37:34 +03:00
Nekotekina
a974ee009e vm::var improved, cleanup
Mostly vm::var initialization introduced.
Added vm::make_var function.
2015-10-14 18:17:37 +03:00
Nekotekina
8ae3401ffa Some things improved
shared_mutex_t implemented
GUI Emu Callbacks rewritten
fxm::import, fxm::import_always implemented
cellMsgDialog rewritten
Emu.CallAfter improved (returns std::future)
2015-09-22 16:48:21 +03:00
Nekotekina
e551e2bc5d Bugfix 2015-08-24 21:22:49 +03:00
Nekotekina
5e14310071 noexcept usage fixed
thread_t renamed to named_thread_t
2015-08-24 21:22:48 +03:00
Nekotekina
d9403c2ed2 thread_t cleanup 2015-08-24 21:22:37 +03:00
Danila Malyutin
009370f73c Fix some compiling problems on OSX
and enable osx builds on travis
2015-08-24 00:20:01 +03:00
Nekotekina
8175630619 sys_cond/sys_mutex improved 2015-07-21 23:14:29 +03:00
Nekotekina
a7668ff57f SPU_EVENT_LR improved 2015-07-21 23:14:22 +03:00
Nekotekina
1e021cdbba waiter_map reintroduced, combined with vm 2015-07-21 23:14:20 +03:00
Nekotekina
82781e620a Small fixes 2015-07-10 04:31:36 +03:00
Nekotekina
c0f13f7084 sleep_queue_t rewritten, used in sys_cond/sys_mutex
Some synchronization fixes
2015-07-10 04:31:34 +03:00
Nekotekina
eafddd9e33 CPUThread fixes, thread_t cleanup 2015-07-10 04:31:32 +03:00
Nekotekina
3064cf8101 CHECK_EMU_STATUS, autojoin_thread_t 2015-07-10 04:31:27 +03:00
Nekotekina
6f1e76198a Some fixes 2015-07-10 04:31:18 +03:00
Nekotekina
3aefa2b4e1 ThreadBase rewritten (wip) 2015-07-10 04:31:16 +03:00
Nekotekina
c598fe7aa9 atomic_op() rewritten, atomic.h refactoring
cellSync refactoring, wait_op() rewritten, bugfixes
2015-07-10 04:31:10 +03:00
Nekotekina
78fdcf75e7 Attribute macro changed
__forceinline -> force_inline
__noinline -> never_inline
printf_alike(x,y) added
2015-05-28 18:14:22 +03:00
Nekotekina
22b78fec71 IdManager improved, atomic_t improved
Various changes
2015-05-27 06:11:59 +03:00
Nekotekina
c5737d01c6 Logging fixed
Now it displays messagebox if logging system isn't initialized.
Otherwise it could cause stack overflow.
2015-04-25 16:29:05 +03:00
Nekotekina
c88e0a0eb9 Small cleanup 2015-03-13 04:09:53 +03:00
Nekotekina
5764ee7a2a Small fix 2015-03-13 02:03:22 +03:00
Nekotekina
4a6ef91eb3 More cleanup 2015-03-07 19:03:42 +03:00
Nekotekina
5f8cf18a5a SPU refactoring 2015-03-03 00:09:20 +03:00
Nekotekina
af986d8f4c Loader improved, ModuleManager refactored 2015-02-18 19:22:06 +03:00
Nekotekina
b897a5d20a cellAudio, thread_t improvements, pause/resume callback 2015-01-17 19:14:58 +03:00
Nekotekina
4dae27c1d4 squeue_t updated 2015-01-16 20:09:53 +03:00
Nekotekina
fd06f70387 cellAudio updated, thread_t updated 2015-01-16 17:36:53 +03:00
Nekotekina
f3cd908d5c Sync primitives reworked
(rwlock rewritten)
2015-01-02 02:41:29 +03:00
Nekotekina
653db28675 removed excessive stuff 2014-12-28 16:15:22 +03:00
Nekotekina
1491dcdc92 squeue_t fix 2 2014-12-26 01:58:43 +03:00
Nekotekina
bdbbde4d36 squeue_t fixed 2014-12-26 01:49:55 +03:00
Nekotekina
c305949435 Compilation fix 2014-12-25 23:30:34 +03:00
Nekotekina
7613d749ec SQueue renamed and moved 2014-12-25 01:24:17 +03:00
Nekotekina
b2de24db73 SMutex eliminated 2014-12-23 02:31:11 +03:00
Nekotekina
18930a43f2 waiter_map_t small fix 2014-10-18 00:13:25 +04:00
Nekotekina
5de059789d waiter_map_t for syncRwm and syncQueue 2014-10-16 23:34:17 +04:00
Nekotekina
18b69cac99 waiter_map_t : concept changed
Purpose-specific waiter_map_t objects instead of global one. SM_Sleep()
removed.
2014-10-16 20:29:41 +04:00
Nekotekina
48eb66383b waiter_reg_t, cellSyncBarrier improved 2014-10-11 02:37:20 +04:00
Nekotekina
3c2e0fff07 waiter_op() and waiter_signal() basis
Simplified signaling on condition variables without using them directly.
2014-10-11 01:33:57 +04:00
Nekotekina
597d07bf24 Small refactoring 2014-09-15 02:17:24 +04:00
Nekotekina
c1da446653 FastCall() removed 2014-09-12 23:27:33 +04:00
Nekotekina
6e02477fc6 Some warnings fixed 2014-09-02 02:35:10 +04:00
Nekotekina
693e7a38fa Some std include moved 2014-08-28 20:29:05 +04:00
Nekotekina
a74e07dc40 Some cleanup 2014-08-25 22:09:48 +04:00