1 / 13

Nachos Walk-through -- Threads

Nachos Walk-through -- Threads. Tingxin Yan 2/9/2010. Logistics. Assignment 1 timeline: Milestone: First two questions. 2/15 – Documentation due. 2/18 – Code due. Deadline: All four questions 2/22 – Documentation due. 2/25 – Code due . What to turn in Documentation Source code

nicki
Download Presentation

Nachos Walk-through -- Threads

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nachos Walk-through-- Threads Tingxin Yan 2/9/2010

  2. Logistics • Assignment 1 timeline: • Milestone: First two questions. • 2/15 – Documentation due. • 2/18 – Code due. • Deadline: All four questions • 2/22 – Documentation due. • 2/25 – Code due. • What to turn in • Documentation • Source code • Tar your threads/ directory.

  3. Logistics • TA office hours: • Time: Friday 4-6 pm • Location: EdLab (LGRC 223-225) • Office hour this week • Bring your laptops • Show me • You have Nachos installed and running • You understand threading system of Nachos • How you split the workload. • You have started your project.

  4. Nachos threads • Lifetime of Nachos threading system • Booting up; • Create new threads; • Running threads; • Finishing all threads and halt.

  5. Creating the first thread • Question: How many threads are created when Nachos is booted? What are they?

  6. Create the ready queue Allocate CPU to the new KThread Set currentThread to the new Kthread Set TCB object Change the status to statusRunning. Create an idle thread.

  7. Make another new KThread, with the target set to an infinite yield() loop. Fork the idle thread off from the main thread.

  8. Creating new threads KThreadnewThread = new KThread(myRunnable); ... newThread.fork();

  9. Creating new threads • Question: why is there a call to ready() method in the fork() method?

  10. Running threads • Question: why is the sleep() method static, while the ready() method isn’t? • Question: At which place in KThread.java is the CPU scheduler called to decide which KThread should be given to CPU?

  11. Finishing a thread • Question: when does Nachos Kernel get rid of resources allocated for a thread that is completed? (using OS language, such as “when a new thread is forked”)

More Related