Commit Graph

231 Commits

Author SHA1 Message Date
Max Kellermann 56bfff5a57 event/ServerSocket: add method IsEmpty() 2018-07-15 21:35:35 +02:00
Max Kellermann d29d186d62 output/alsa: use a new I/O thread with real-time scheduling
The normal I/O event thread can have a large latency, e.g. when
libgnutls loads all TLS CA certificates for a https connect.  This
makes it unreliable for the ALSA I/O notifications, and causes ring
buffer xruns.  To avoid interfering with high latency events such as
CURL's, we move the ALSA I/O events to a separate I/O thread which
also obtains real-time scheduling (if possible).

Closes #221
2018-02-16 22:38:55 +01:00
Max Kellermann 19af364400 event/Thread: add "noexcept" 2018-01-29 23:11:15 +01:00
Max Kellermann 3fd9a86f3c event/Call: invoke function directly if the EventLoop is dead
Works around a deadlock bug which happens when waiting for an
EventLoop which isn't running anymore.
2018-01-29 23:06:43 +01:00
Max Kellermann ce68701c0c event/Loop: add flag "dead" 2018-01-29 22:52:13 +01:00
Max Kellermann 6ea2cb3644 event/Thread: remove unused method StopAsync() 2018-01-29 22:50:21 +01:00
Max Kellermann 199c8aaa25 event/Loop: move code to HandleTimers() 2018-01-29 22:40:12 +01:00
Max Kellermann 3890bc5a96 event/Loop: add "noexcept" 2018-01-29 22:05:58 +01:00
Max Kellermann 2c65f986d6 event/EPoll: use C++11 initializer 2018-01-29 22:05:13 +01:00
Max Kellermann ea402b765c event/WinSelect: pass const reference to copy constructor 2018-01-29 22:05:13 +01:00
Max Kellermann 497e0669ff event/PollResult: use size_t for size and index 2018-01-29 21:56:12 +01:00
Max Kellermann bbc5212436 fs/AllocatedPath: make the nullptr_t constructor public 2018-01-17 12:17:41 +01:00
Max Kellermann f8bb66b4e0 event/Loop: use std::atomic_bool for the "quit" variable
Fixes thread sanitizer warnings.
2017-12-22 11:04:24 +01:00
Max Kellermann 36899dba0b event/Call: document exceptions 2017-12-20 10:50:36 +01:00
Max Kellermann 6a31446671 event/TimerEvent: add "noexcept" 2017-12-20 10:45:30 +01:00
Max Kellermann 451fbbcea1 event/FullyBufferedSocket: add "noexcept" 2017-12-20 10:44:47 +01:00
Max Kellermann a17a481e30 event/BufferedSocket: add "noexcept" 2017-12-20 10:42:17 +01:00
Max Kellermann 914df18bf9 Main, ...: catch any exception, not just std::runtime_error 2017-12-19 10:56:23 +01:00
Max Kellermann 6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Max Kellermann dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann c582a9faae event/MultiSocketMonitor: add "noexcept" 2017-11-12 17:42:50 +01:00
Max Kellermann cf483107c9 event/IdleMonitor: add "noexcept" 2017-11-12 17:40:25 +01:00
Max Kellermann b57e2f5521 event/DeferredMonitor: eliminate obsolete class
Move its code to DeferEvent instead.
2017-11-12 17:34:06 +01:00
Max Kellermann bf3ced6a34 event/Call: migrate from DeferredMonitor to DeferEvent 2017-11-12 17:32:23 +01:00
Max Kellermann 42ad753e39 event/MaskMonitor: migrate from DeferredMonitor to DeferEvent 2017-11-10 21:10:46 +01:00
Max Kellermann 593d82c6a9 event/DeferEvent: add "noexcept" 2017-11-10 20:55:24 +01:00
Max Kellermann 43dccbd45d event/SocketMonitor: remove unused method Abandon() 2017-11-10 20:52:37 +01:00
Max Kellermann 0ff4350352 event/ServerSocket: pass UniqueSocketDescriptor by value
Passing it by value is actually smaller (32 bit) than the rvalue
reference (64 bit pointer), and it ensures that the object is consumed
after the call returns, no matter how the methods are implemented.
2017-11-10 20:43:14 +01:00
Max Kellermann 5fd2b7cc79 event/SocketMonitor: eliminate Read(), Write()
Migrate callers to GetSocket().Read(), GetSocket.Write(), which is the
same.
2017-11-10 20:37:52 +01:00
Max Kellermann 7e16ac305d event/SocketMonitor: rename Get() to GetSocket() 2017-11-10 20:34:45 +01:00
Max Kellermann 59a8836924 event/SocketMonitor: add "noexcept" 2017-11-10 20:20:07 +01:00
Max Kellermann 9d4020501c event/SocketMonitor: make constructor "explicit" 2017-11-10 20:17:27 +01:00
Max Kellermann 81350d65bc event/SocketMonitor: use C++11 initializers 2017-11-10 20:16:26 +01:00
Max Kellermann 3c41e9f022 evnet/SocketMonitor: move WIN32/ERROR comment to PollGroupWinSelect.hxx 2017-11-10 19:57:54 +01:00
Max Kellermann 49784513b1 util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL 2017-11-10 19:24:33 +01:00
Max Kellermann 9df4853e23 event/DeferredCall: rename to DeferEvent 2017-09-21 22:40:25 +02:00
Max Kellermann 987c505906 event/TimeoutMonitor: remove obsolete class 2017-08-29 16:53:15 +02:00
Max Kellermann 7ae57a3531 event/MultiSocketMonitor: migrate from TimeoutMonitor to TimerEvent 2017-08-29 16:28:27 +02:00
Max Kellermann 30a5dd267b event/TimeoutMonitor: move code to new class TimerEvent 2017-08-29 16:28:27 +02:00
Max Kellermann 2f0d683378 event/Loop: fix inverted checkin RemoveDeferred() 2017-08-29 16:28:24 +02:00
Max Kellermann a1309a90ac event/Loop: use boost::intrusive::list to store IdleMonitors and DeferredMonitors
The intrusive contains can easily erase items without searching
through the whole list.  This removes a good amount of runtime
overhead.
2017-08-29 15:43:16 +02:00
Max Kellermann 010855a294 event/Loop: use boost::intrusive::multiset to store TimeoutMonitors
By using an "intrusive" data structure, we can easily eliminate
struct TimerRecord.
2017-08-29 14:42:59 +02:00
Max Kellermann 71ed3ff992 event/Loop: move TimerRecord::due to class TimeoutMonitor
Prepare to eliminate the TimerRecord struct.
2017-08-29 14:13:09 +02:00
Max Kellermann d4266d0063 event/Loop: remove unused method TimerRecord::IsDue() 2017-08-29 13:41:11 +02:00
Max Kellermann 5ac72211cd event/Loop: set thread to current thread by default
Allows eliminating lots of complexity and workarounds for bogus
assertion failures.
2017-08-18 18:18:55 +02:00
Max Kellermann 7f9a2f8adb event/Loop: schedule and cancel the WakeFD in Run()
This is only needed while Run() is alive, and moving it there avoids
problems with thread-checking assertions.
2017-08-18 18:08:06 +02:00
Max Kellermann 6d43e70a93 event/SignalMonitor: throw exception instead of raising fatal error 2017-08-11 09:36:22 +02:00
Max Kellermann 33b4114534 system/fd_util: remove unused library 2017-08-11 09:20:15 +02:00
Max Kellermann d705a92e43 net/IPv4Address: new class 2017-08-11 09:09:04 +02:00
Max Kellermann 1f47dc990d net/SocketDescriptor: add method SetKeepAlive() 2017-08-10 19:25:02 +02:00