This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: INTRODUCTION TO L A T E X Homework 1 Nafn Nafnsson January 24, 2012 Problem 1. Give a grammar that can be used to derive all binary strings of even length, and no other. Show how it can derive the empty string and the string 0111. Can you argue that you can derive any binary string with the stated property using your grammar? Solution. If threads are implemented in user space, the operating system does not need to support threads, since each process manages its own threads, and the OS need not know they exist. Each process can also schedule its own threads as it pleases, and does not have to rely on schedule of the OS. Kernel level threads, on the other hand, must be maintained by the OS which has to keep a thread table in the kernel, which can cause problems if there are many threads, since kernel threads can require some table space and stack space in the kernel. Switching threads in user space threads is also very cheap since the switch is done inside the process, but switching kernel space threads requires a trap, a context switch, a memory ush,...
View Full Document
- Spring '10