Age | Commit message (Collapse) | Author |
|
It seems somewhat dangerous to have to manually increment the number of
threads every time we make a process. This change makes every call to
proc_init() increment the number of threads. The value is decremented
once the process exits.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
This commit moves a lot of initialization logic within spawn() into
the proc_init() function. The logic of spawning a process from an
executable should not have mixed with the logic of initializing a
process.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Deprecate SPAWN_WAIT in favor of waitpid()
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Add waitpid() in preparation of deprecating SPAWN_WAIT.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Previously, our process counter was monotonic (wuh oh!). We want to be
sure that it decrements when a process exits.
- Rename nthreads to g_nthreads as a global
- Atomically increment on enter and decrement on exit
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Add SPAWN_WAIT flag that causes spawn() to wait until the child process
completes.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
This commit introduces a more complete spawn implementation as well as
the SYS_spawn syscall and a libc interface.
Signed-off-by: Ian Moffett <ian@osmora.org>
|
|
Simplicity is divine, fork() may be powerful but is no longer simple. It
became a thing in the late 70s during the early days of UNIX when computing
was simple, when CPUs were only 16-bits, MMUs were not prevalent and RAM was
only 512 KB. However it isn't 1971 anymore, process management, CPUs and memory
architecture has advanced significantly since. This commit ceases work on the
fork() syscall as implementing it would only introduce unnecessary complexity,
security issues, hefty processing overhead and would perpetuate what should
now be considered legacy. The current best alternative would be providing
a form of process spawning as well as a mechanism to wait for the child
process to complete.
Signed-off-by: Ian Moffett <ian@osmora.org>
|