Re: [capnproto] Xcode hits SIGUSR1 signal when I use an Executor

2022-09-02 Thread 'Kenton Varda' via Cap'n Proto
Hi Jens, Two options for writing sync-like code that is actually async: - KJ supports "Fibers", which allocates a separate stack that runs in the same thread. When running on that stack, you get a `WaitScope` that you can use to wait on promises. When you wait, the thread switches back to the main

Re: [capnproto] Xcode hits SIGUSR1 signal when I use an Executor

2022-08-31 Thread Jens Alfke
> On Aug 30, 2022, at 7:37 PM, 'Kenton Varda' via Cap'n Proto > wrote: > > Hi Jens, > > It sounds very obnoxious that your debugger insists on breaking on this > signal. I’ve filed a bug report with Apple. > With that said, you could try compiling with `-DKJ_USE_PIPE_FOR_WAKEUP`, > whic

Re: [capnproto] Xcode hits SIGUSR1 signal when I use an Executor

2022-08-30 Thread 'Kenton Varda' via Cap'n Proto
Hi Jens, Indeed, KJ uses SIGUSR1 to communicate between threads. It sounds very obnoxious that your debugger insists on breaking on this signal. The signal is not a problem, it's a normal part of KJ's operation. With that said, you could try compiling with `-DKJ_USE_PIPE_FOR_WAKEUP`, which causes

Re: [capnproto] Xcode hits SIGUSR1 signal when I use an Executor

2022-08-30 Thread Jens Alfke
TL;DR: Can the two streams created by kj::newTwoWayPipe() be used on different threads? It kind of appears not. I’ve found a workaround, the LLDB command process handle --stop false SIGUSR1 Unfortunately adding it to my .lldbrc file does nothing; I have to enter it by hand every time I

[capnproto] Xcode hits SIGUSR1 signal when I use an Executor

2022-08-30 Thread Jens Alfke
I have Cap’nProto RPC (in C++, on macOS) working well on the main thread, but I want to move it to a background thread for various reasons. However, my process is now raising SIGUSR1 signals, which the debugger breaks at, preventing the code from working. I’m following the directions in the doc