diff options
author | Pavel Labath <pavel@labath.sk> | 2023-03-27 17:39:55 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2023-03-30 12:48:36 +0200 |
commit | e64cc756819d567f453467bf7cc16599ad296fdd (patch) | |
tree | ddfe6ab160305b480a903405528675b34681a6b3 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h | |
parent | 44f0c9145c947d660b416bdad61874fd9d73bbae (diff) | |
download | llvm-e64cc756819d567f453467bf7cc16599ad296fdd.zip llvm-e64cc756819d567f453467bf7cc16599ad296fdd.tar.gz llvm-e64cc756819d567f453467bf7cc16599ad296fdd.tar.bz2 |
[lldb-server/linux] Use waitpid(-1) to collect inferior events
This is a follow-up to D116372, which had a rather unfortunate side
effect of making the processing of a single SIGCHLD quadratic in the
number of threads -- which does not matter for simple applications, but
can get really bad for applications with thousands of threads.
This patch fixes the problem by implementing the other possibility
mentioned in the first patch -- doing waitpid(-1) centrally and then
routing the events to the correct process instance. The "uncollected"
threads are held in the process factory class -- which I've renamed to
Manager for this purpose, as it now does more than creating processes.
Differential Revision: https://reviews.llvm.org/D146977
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index 1165b60..244ef47 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -35,7 +35,7 @@ public: // Constructors and Destructors GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, - const NativeProcessProtocol::Factory &process_factory); + NativeProcessProtocol::Manager &process_manager); void SetLaunchInfo(const ProcessLaunchInfo &info); @@ -99,7 +99,7 @@ public: protected: MainLoop &m_mainloop; MainLoop::ReadHandleUP m_network_handle_up; - const NativeProcessProtocol::Factory &m_process_factory; + NativeProcessProtocol::Manager &m_process_manager; lldb::tid_t m_current_tid = LLDB_INVALID_THREAD_ID; lldb::tid_t m_continue_tid = LLDB_INVALID_THREAD_ID; NativeProcessProtocol *m_current_process; |