|
|
Log in / Subscribe / Register

fork() + exec()

fork() + exec()

Posted Jun 5, 2026 22:07 UTC (Fri) by Cyberax (✭ supporter ✭, #52523)
In reply to: fork() + exec() by roc
Parent article: Moving beyond fork() + exec()

A lot of software might be _avoiding_ the subprocesses exactly because they are so horrible. In my case, we actually used a "process runner" server in one project to avoid forking in a large Java app. We needed it to do text extraction from Microsoft documents and for image parsing/resizing.


to post comments

fork() + exec()

Posted Jun 9, 2026 0:09 UTC (Tue) by csamuel (✭ supporter ✭, #2624) [Link]

There's another example from the HPC community - the batch system Slurm has a slurmctld which handles the queue of active and pending jobs and can get very large when you've a big queue (10s of GBs of RAM). It also used to fork/exec to do things like run certain scripts (when configured) at various times of the job lifecycle and (which we would see more commonly) send emails when a job started/completed/failed (depending on which options the user selected at job submission time). When you can be starting and ending many jobs per second that became... suboptimal.

So SchedMD (who maintain Slurm) decided to implement a separate daemon (slurmscriptd) which was forked from slurmctld at startup and then it would be sent messages for things to do on its behalf. That relieved massively the overhead of continual fork/exec a huge process for this.

All the best,
Chris


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds