Lesson 18 Notes
Page 1 of 1
Lesson 18 Notes
Process
• PID
• State
• Child Process
• Memory Location (page table)
• Maybe Dynamic stack/heap allocation
• List of Open Files (should we share them?)
Do we need all of this information in the thread? No, we don’t
Thread
• Stack
• Registers
• Instruction Pointer, Stack Pointer
• Parent Process points directly to the PID
Process.. .if single threaded… or multi threaded have to map into Kernel.
Problem with multithreads? Hard for intercommunication.
How many threads can I have in my kernel? One-to-One
Downside of preallocating those threads? They take up space and time.
What happens if you do this in the USER SPACE?
• This can be changed in the implementation.
Kernel:
• One t one is down in the kernel space. The implementation is down in the kernel space
User:
• It is in an interface
For a Many to one:
• You have to write the interface + implementation in the user space. User space => virtual memory. Kernel => physical memory
• If you are doing a lot of I/O stuff... MANY to 1 at the user space may not be a good idea. Not much I/O because whole system will wait. If you do a one-to-one you won't have that problem. It will put the individual threads in its own thing. Trade Off.... you have to do a context switch from user mode to kernel mode.[b]
• PID
• State
• Child Process
• Memory Location (page table)
• Maybe Dynamic stack/heap allocation
• List of Open Files (should we share them?)
Do we need all of this information in the thread? No, we don’t
Thread
• Stack
• Registers
• Instruction Pointer, Stack Pointer
• Parent Process points directly to the PID
Process.. .if single threaded… or multi threaded have to map into Kernel.
Problem with multithreads? Hard for intercommunication.
How many threads can I have in my kernel? One-to-One
Downside of preallocating those threads? They take up space and time.
What happens if you do this in the USER SPACE?
• This can be changed in the implementation.
Kernel:
• One t one is down in the kernel space. The implementation is down in the kernel space
User:
• It is in an interface
For a Many to one:
• You have to write the interface + implementation in the user space. User space => virtual memory. Kernel => physical memory
• If you are doing a lot of I/O stuff... MANY to 1 at the user space may not be a good idea. Not much I/O because whole system will wait. If you do a one-to-one you won't have that problem. It will put the individual threads in its own thing. Trade Off.... you have to do a context switch from user mode to kernel mode.[b]
Similar topics
» Lesson 19
» Lesson 19 - InClassNotes
» Lesson 19: The Hapsburg Recovery 108 - 133
» Lesson 18 - Static/Dynamic Link
» Lesson 19 - Threads, Tasks & Concurrent Programming (pg 241 - 255)
» Lesson 19 - InClassNotes
» Lesson 19: The Hapsburg Recovery 108 - 133
» Lesson 18 - Static/Dynamic Link
» Lesson 19 - Threads, Tasks & Concurrent Programming (pg 241 - 255)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum