0

For example, when we call write(...) in program in minix. Does a new process is created(like with fork()) or is it done within current process? Is it efficient to make a lot of syscalls?

zlenyk
  • 922
  • 2
  • 7
  • 22

1 Answers1

1

Process creation is strictly fork's / exec's job. What kind of process could a system call like write possibly spawn?

Now, Minix is a microkernel, meaning that things like file systems run in userland processes. Writing to a file could therefore possibly spawn a new process somewhere else, but that depends on your file system driver. I haven't paid attention to the MinixFS driver so far, so I can't tell you whether that happens -- but it's not very likely, process creation still being relatively expensive.

It's almost never efficient to make a lot of syscalls (context switches being involved). However, "performant", "efficient" and "a lot" are all very relative things, so I can't tell you something you probably don't know already.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94