24 topics
Operating systems help, including where the race condition actually is
Two threads running the line counter = counter + 1 can leave counter at 1 after both finish, because that one line is three machine operations and either thread can be paused between them. Spotting that is the whole skill an operating systems course is testing, and it is why the concurrency section defeats students who can otherwise recite every definition on the slides.
Where students get stuck
How do I tell whether a code fragment has a race condition?
Find every piece of state that more than one thread touches, and ignore everything else. Local variables on a thread's own stack are safe. For each piece of shared state, check whether a read and a later write are separated by anything at all, including an innocent-looking increment or an if-statement that checks a flag before acting on it. If yes, the scheduler is allowed to interleave another thread in that gap. Then ask what that other thread would see. If the answer is stale data, you have found it.
Process or thread — I can recite the definitions but not apply them
Use the memory question. Threads inside one process share the heap and the code, so they can pass a data structure by pointer and communicate for free — and corrupt each other's data for free too. Separate processes have separate address spaces, so a crash in one cannot corrupt the other, but talking between them needs pipes, sockets, or shared memory you set up deliberately. So the trade is speed of communication against isolation. Browsers put tabs in processes for exactly that reason.
The four deadlock conditions feel arbitrary
They are not four rules to memorise, they are four places to attack, and each prevention strategy in your notes is just one of them broken. Mutual exclusion means the resource cannot be shared. Hold and wait means a thread keeps what it has while asking for more. No preemption means nothing can be forcibly taken back. Circular wait means the request graph has a cycle. All four must hold at once. That is why imposing a global lock ordering works: it makes a cycle impossible, and one broken condition is enough.
What does the page table actually translate?
It translates the page number, not the whole address. Split the virtual address in two: the high bits are the page number, the low bits are the offset within the page. The offset passes through untouched, because pages in virtual memory and frames in physical memory are the same size. Only the page number gets looked up, and it comes back as a frame number that is concatenated with the untouched offset. Once that split is clear, page size, offset bit count, and table size questions all become arithmetic.
I added more frames and page faults went up
That is Belady's anomaly, and it is a real result rather than a mistake in your trace. It happens with FIFO replacement, because FIFO evicts by arrival order and pays no attention to whether a page is about to be used again. Adding a frame can change the eviction order in a way that throws out exactly the wrong page. LRU and other stack algorithms cannot show the anomaly, since a larger frame set always contains everything a smaller one would have held. If your answer shows it under FIFO, keep it.
What's covered
Operating Systems topics you can work through with a tutor, generate practice on, or turn into flashcards and a study plan.
Processes and threads
- Process states and the process control block
- Context switching
- Threads, concurrency, and parallelism
- Inter-process communication: pipes and shared memory
- System calls and kernel versus user mode
Scheduling
- First-come first-served, SJF, and round robin
- Priority scheduling and starvation
- Turnaround, waiting, and response time
- Multilevel feedback queues
Synchronisation
- Critical sections and mutual exclusion
- Mutexes, semaphores, and monitors
- Producer–consumer and readers–writers
- Deadlock detection, prevention, and avoidance
- The banker's algorithm
Memory management
- Contiguous allocation and fragmentation
- Paging, page tables, and the TLB
- Segmentation
- Virtual memory and demand paging
- Page replacement: FIFO, LRU, and optimal
- Thrashing and the working set
Storage and I/O
- File system structure and inodes
- Disk scheduling algorithms
- RAID levels
- Device drivers and interrupts
Operating Systems questions
Can it work a scheduling problem on the whiteboard with me?
Yes, and Gantt charts are one of the clearest uses of it. It draws the timeline as you go and computes waiting and turnaround times per process, which is where arithmetic slips usually cost the marks rather than the concept.
My C code with pthreads deadlocks intermittently. Is that fixable in a session?
Often, because intermittent deadlocks are usually a lock-ordering problem you can read off the source. Share your screen and it will walk the acquisition order in each thread with you to look for the cycle.
How do I revise the algorithms without just re-reading the notes?
Ask for practice problems on one algorithm at a time — a page reference string, or a set of arrival and burst times — and it returns them with full worked solutions so you can compare your method, not just your final number.
The textbook is dense and I've fallen behind. Where do I start?
Start with the concurrency chapter rather than the beginning, since almost everything later assumes it and it is the section most exams weight heavily. Say out loud what you already understand and it will find the actual gap.
Stuck on operating systems right now?
Talk it through out loud, share your screen, and watch it worked out step by step on a whiteboard.
Start free — no card