SchOS/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz f4d7f9100d Threads
A thread is a struct proc that shares three counted objects with others of
its group: the address space (struct mm: page tables, heap top, VMAs and a
lock for changing them), the descriptor table, and the signal dispositions.
clone() shares what its flags say and fork() copies.

- clone(): pthread_create's shape (VM, FILES, SIGHAND, THREAD, SETTLS,
  PARENT_SETTID, CHILD_CLEARTID) and posix_spawn's (VM, VFORK, a stack).
- futex: WAIT, WAIT_BITSET with timeouts, WAKE, REQUEUE, CMP_REQUEUE, keyed
  by the word's kernel address so shared pages meet. set_tid_address keeps
  the word that exit zeroes and wakes, for pthread_join.
- exit ends a thread; exit_group, a fatal signal, or the leader exiting ends
  them all. reapd frees exited threads; the leader is reaped by its parent
  once the rest are gone. getpid is the group, gettid the thread.
- Stops and resumes reach every thread; other process signals the leader.
- exec kills the other threads and unshares the dispositions.
- No TLB shootdown, so pages unmapped from a shared address space are freed
  only once every CPU has reloaded CR3 or is idle.
- procfs: /proc lists processes, task/ lists threads, comm, Threads:, Tgid.
- The console honours VMIN 0 / VTIME (btop's input drain hung on it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
2026-10-25 03:03:50 +01:00
..
acpi boot: driver chatter goes to the log; the console clears its margins 2026-10-25 01:53:46 +02:00
arch/x86_64 Threads 2026-10-25 03:03:50 +01:00
core Threads 2026-10-25 03:03:50 +01:00
dev Threads 2026-10-25 03:03:50 +01:00
drivers Job control, function keys, and real sleeps 2026-10-25 02:37:45 +01:00
fs Threads 2026-10-25 03:03:50 +01:00
gmmos GMMOS: USB keyboards on xHCI 2026-10-25 01:23:14 +02:00
net Threads 2026-10-25 03:03:50 +01:00
proc Threads 2026-10-25 03:03:50 +01:00
scff SCFF: the live root ships compressed, with Xorg and Window Maker 2026-10-24 21:17:31 +02:00
sys Threads 2026-10-25 03:03:50 +01:00
kernel.ld kernel: load at 16 MB, clear of what firmware keeps low 2026-10-24 00:13:53 +02:00