Re: [capnproto] Thread pool executor

2021-07-31 Thread Alessandro Arcangeli
Hi Kenton, thanks for the response. I'm currently trying to use an EventPort for fetching jobs from a shared queue. The problem is that once a job is completed I have no way to return to the caller thread. I read from another discussion about newCrossThreadPromiseAndFulfiller, this would be

Re: [capnproto] Thread pool executor

2021-07-30 Thread 'Kenton Varda' via Cap'n Proto
Hi Alessandro, KJ doesn't currently have any built-in thread pool implementation. The KJ async / Promise framework is centered around single-threaded event loops, so probably isn't what you're looking for. I guess if I were implementing this I'd write a class that creates threads using

[capnproto] Thread pool executor

2021-07-30 Thread Alessandro Arcangeli
Hi there, I'm trying to implement a pool thread executor using KJ. I mean an executor that has a list of threads and sends the job to the "most empty" one. Or better, when a thread finish his job (or it is blocked by an IO) it automatically pick the next job from the executor. I looked up