project updates and started process-spawn

This commit is contained in:
Pagwin 2025-07-17 13:21:22 -04:00
parent 7a589006a3
commit 06eee6c688
7 changed files with 26 additions and 6 deletions

View file

@ -10,3 +10,21 @@ draft: true
tags: []
---
So from various places for various reasons I've learned a bit about how process spawning on Linux works.
So I thought I'd write it all down to clarify what I know and maybe do some research in the process.
## Scope
This post is focused on what happens when a process wants to make another process.
It will not cover how shells parse out commands, how init systems work etc.
## Choose Your Syscall(s)
![Two wolves meme with Fork/Exec and Clone](/static/images/two-ways-of-spawning-processes.jpg)
When it comes to spawning a child process on Linux there are two general ways of doing it.
- call `fork` and then call `exec` in the child process
- call `clone`
Generally speaking you want to use `clone` due to `clone` being more flexible and allowing you to use fewer syscalls to achieve what you want.

View file

@ -21,7 +21,7 @@ The end result of this project was a system where start and endpoints could be i
## What was learned
1) **anything which is the output of a program should not be checked into the version control system** that output is a build artifact, something which should be generated on/pre startup or something which should be generated on demand.
2) Barring genuinely hard problems the first unit (probably week) of work on a project should be scoped to whatever the MVP is.
2) Barring genuinely hard problems the first unit (most of the time a week) of work on a project should be scoped to whatever the MVP is.
3) If I'm working in a team which I want to get things done and nobody has taken charge by the end of the first unit of work I need to take charge.
4) If in a team where I'm in charge I should never assume responsiveness (responding to communication and getting work done) from any team member regardless of prior knowledge.

View file

@ -8,4 +8,4 @@ If I remember correctly this was intended to use HTMX to minimize the need for p
## What was learned
At the time besides probably realizing that I should've had the service use an SMTP connection instead of some specific API and with hindsight that I should've used sqlite rather than PostgreSQL for that project.
At the time besides realizing that I should've had the service use an SMTP connection instead of some specific API and with hindsight that I should've used sqlite rather than PostgreSQL for that project.

View file

@ -15,7 +15,7 @@ So they have multiple computers that communicate with each other to do this.
Notably each computer doesn't just change variables willy nilly, instead they keep a log of everything that's happened and using that log figure out what the current state of things is.
In the Bank analogy this log would probably contain things like.
In the Bank analogy this log would contain things like.
- Person A deposits x dollars
- Person A withdraws x dollars

View file

@ -10,5 +10,7 @@ Compared to manually needing to keep track of whether anything is using a pointe
## What was learned
I won't go into detail but I did not finish everything needed for this assignment.
The simple lesson which I will undoubtedly need to relearn over and over again is that I shouldn't procrastinate, things can be harder/take longer than expected.
I shouldn't procrastinate.
<script>
//I won't go into detail but I did not finish everything needed for this assignment.
//The simple lesson which I will undoubtedly need to relearn over and over again is that I shouldn't procrastinate, things can be harder/take longer than expected.</script>

View file

@ -8,5 +8,5 @@ I also had time to build a not great looking web ui for it.
## What was learned
This is probably one of the earlier instances of me working on something with a very tight deadline where I found that constraint made me worke more effieciently than I normally do.
This is one of the earlier instances of me working on something with a very tight deadline where I found that constraint made me worke more effieciently than I normally do.
This takeaway is something which I don't think I've fully internalized yet but it is something I will occasionally stumble into under the right circumstances.

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB