Each process has: Open Files Memory space An exclusive-looking processor Maybe more than one thread A thread is a special process on Linux Shares memory space and open files, but not processor Actual process descriptor is kinda long and has a lot of options Quick reminder on making them: fork splits processes This is a traditional way to make, for example, a shell Must wait on processes that finish threading constructs like pthread_create make threads For 435, most people use multithreading C++ has an object-based wrapper over pthreads States: Running Interruptible (sleeping) Uninterruptible (sleeping, but can't wake up without signal) traced (by a debugger or whatnot) stopped (what you get when you hit ctrl+z) Kernel has a set_task_state function for it That could be fun... Process family tree pstree Shows which processes are running Copy-on-write fork: Don't actually copy all data to child processes Only if it's used Child also inherits file descriptors Thread note and clone: Call clone with particular arguments to gt thread Basically, don't duplicate a lot of stuff that's normally duplicated clone has pretty detailed arguments man page Lazy parents: I did this in 253, but let's make a zombie The solstop module example We'll talk about scheduling next time