[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The Shepherd on Fibers
From: |
Zhu Zihao |
Subject: |
Re: The Shepherd on Fibers |
Date: |
Sat, 26 Mar 2022 19:27:00 +0800 |
User-agent: |
mu4e 1.6.10; emacs 27.2 |
IIUC, After fork and execute the program, shepherd will wait for the pid
file to appear. This is a block operation.
Shepherd on Fiber make this operation non-blocking (because the pid file
is created by Linux kernel, Shepherd just need to wait for it), every
service activation runs on its own fiber. after fork+exec, shepherd
suspend current fiber, andspawn another fiber to start another service
immediately.
But finally all fibers are co-operatively scheduled on 1 thread.
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:
> On Sat, Mar 26, 2022 at 07:09:12PM +0800, Zhu Zihao wrote:
>> > So shepherd service authors still cannot write blocking code but need
>> > to yield?
>>
>> IMO, service should not block service, if they have something important
>> to do before running a program, why not fork first and do it in the
>> child-process (maybe wrap the actual startup program in Guile script)?
>
> In other words, all stays the same as without fibers?
>
> Regards,
> Florian
--
Retrieve my PGP public key:
gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F
Zihao
signature.asc
Description: PGP signature
Re: The Shepherd on Fibers, Ludovic Courtès, 2022/03/29
Re: The Shepherd on Fibers, Maxime Devos, 2022/03/26
Re: The Shepherd on Fibers, Maxime Devos, 2022/03/26