Linux system for our class:
sf06.cs.umb.edu
- ssh from home machine
- ssh from other cs.umb.edu system
OS provides virtual machine for each process
- virtual address space(flat address space): one for each process
- virtual CPU: one for each thread
- syscalls for I/O, time, etc
Previously looked at classic 1 process-1 thread case.
Case of 2 threads (thread provided by OS not user-level threads)
- one virtual address space, shared between threads
- two virtual CPUs
- system calls: they execute independently in the threads
“User-level threads”: means writing a scheduler in app code supporting threads
- disadvantage1: can’t provide independent syscalls
- disadvantage2: can’t use multi-processors
- no longer needed: today’s OS’s provide high-performance threads, thanks to web server needs for many threads and competition between OS vendors for web server systems
1 process 1 thread
![]() |
1process 2threads
kernel: will cover in future—each thread has a kernel stack
both threads can be executing in kernel code, each doing a syscall for its thread
Virtual CPU: is in fact a real CPU (its general registers and non-privileged instructions) for one quantum of time (e.g. 20ms)
CPUs are currently either “32-bit” or “64-bit”: this means they use memory addresses that are 32 bits or 64 bits wide, for the user address space (and kernel too). Thus their general registers need to be able to hold 32 or 64 bits, and this can be useful for integers as well as addresses.
![]() |
The current 64 bit processors use 64 bit addresses, but don’t actually support full 64 bit address space which would be 264 bytes: 224 TB > 1 million TB
- Current Intel 64 bit processors support 47 bits of addressing at bottom and 47 bits at top of VA space, providing 247 = 27 TB = 128 TB address space parts
o 0 ~ 0x7ffff ffff ffff (expected max user address space)
o ffff 1000 0000 0000 ~ ffff ffff ffff ffff(highest possible 64 address)
UNIX pmap utility display the address for a given process (Chapter 14. memory areas in real life)
pmap pid
int main(…)
{
sleep(100); <---- add to Love’s code on pg. 260, so process hangs around a while
return 0;
}