Spawning meaning in the computer:

The process of creating a child process and executing the child process is known as spawning. In Linux spawning is also known as forking and executing (exec). In windows, the process of forking and executing is not present but windows have the same process known as spawning.

Spawning in linux
Spawning in windows

Spawning is seen in many computer games also. For example in video games, the game character is given new life which is known as spawning. The process of creating a same copy of parent is called spawning. In video games, we can spawn any things like spawning of guns i.e. creating new guns that are similar to previous guns. Also opening new tabs in browser or opening child windows is done with spawning.

Spawning is similar to as we create different threads in the operating system. Threads are executed in parallel within the big program. Similarly, within any parent process, different child processes are created and executed in parallel. The benefit of spawning is that there will be no single process executing but many child processes are running in parallel which completes any task quickly. If the parent process only runs then the process has to wait a long time if many inputs are given.

There are three main types of spawn in windows:-

  • Spawn
  • Spawnlp
  • Spawn
  • Spawnvp

These methods of spawn get different parameters i.e. the path of file, inputs and null for terminating the inputs.


Share This Story, Choose Your Platform!