Nekotekina
e055d16b2c
Replace verify() with ensure() with auto src location.
...
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
Nekotekina
cc07e5306e
Improve shared_mutex
...
Wait/notify only on c_sig, should reduce spurious wakeup noise.
2020-11-06 00:10:16 +03:00
Nekotekina
050c3e1d6b
Rewrite cpu_thread::suspend_all
...
Now it's a function of higher order.
Make only one thread do the hard work of thread pausing.
2020-10-10 13:58:48 +03:00
Nekotekina
8886414013
Use atomic wait in shared_mutex and semaphore
2019-07-29 03:04:55 +03:00
Nekotekina
090c71aa7c
TSX: Improve cpu_thread::suspend_all implementation
...
Implement low_lock and vip_lock (for shared_mutex).
Try to simplify suspend_all implementation with updated shared_mutex.
2019-07-24 17:25:52 +03:00
Nekotekina
96cabeadff
Rewrite condition variables
...
Implement helper functions balanced_wait_until and balanced_awaken
They include new path for Windows 8.1+ (WaitOnAddress)
shared_mutex, cond_variable, cond_one, cond_x16 modified to use it
Added helper function utils::popcnt16
Replace most semaphore<> with shared_mutex
2018-11-29 01:30:05 +03:00
Nekotekina
6104685ad6
Implement cond_one sync primitive
...
Change futex() args to use unsigned int
2018-11-05 13:14:11 +03:00
Nekotekina
7a024f3355
Implement shared_mutex::lock_unlock
...
Minor fix for shared_mutex::try_lock - don't optimize for pessimistic case
2018-10-02 02:22:26 +03:00
Nekotekina
9e5b633779
shared_mutex cleanup
...
Rewrite to use unsigned arithmetic, shrink to u32
Ensure zero default unlocked state (will need it later)
Inline all public methods, rewrite lock_upgrade()
Remove try_lock_degrade(), lock_degrade() methods
Implement lock_downgrade() (now trivial)
Remove is_reading(), added is_free()
Added reader_lock::try_upgrade()
2018-09-27 12:16:43 +03:00
Nekotekina
445e5def42
Remove safe_reader_lock, safe_writer_lock
...
It worked as a simple recursive locker for shared_mutex
But its design is flawed and thus can't be fully implemented
2018-09-15 17:09:56 +03:00
Nekotekina
fb5cdf9769
atomic_t<>: extend fetch_op to support cancellation
...
Use std::invoke inside atomic_op/fetch_op
Remove op_fetch because it's easily replaced
Add fetch_dec_sat algorithm (conditional decrement)
2018-09-08 00:32:04 +03:00
Nekotekina
7f542a5c99
Fix safe_writer_lock (typo)
2018-03-11 19:33:01 +03:00
Nekotekina
beab5291bb
mutex.cpp: minor update
...
New concept (incomplete)
2017-10-05 19:51:37 +03:00
Ryan Gonzalez
e447f071ce
Misc compile fixes
2017-04-18 22:37:17 +03:00
Ivan
1ae334e500
Fix freezes on Linux ( #2632 )
2017-04-04 23:27:16 +03:00
Nekotekina
f35babad98
shared_mutex fix (linux)
2017-02-24 18:48:53 +03:00
Nekotekina
b1aa87b515
Busy waiting added
2017-02-16 00:13:55 +03:00
Nekotekina
1c14d872a8
New shared_mutex
...
Experimental sync utils
New semaphore<>
New cond_variable
New owned_mutex
2017-01-25 00:38:07 +03:00