BS1 WS19/20 – topic-based slides
Multithreading (Windows)
- Process Creation / Exiting / Termination
- Comparison between UNIX and Windows
- Thread Creation / Termination / Suspending / Resuming
- Fibers
- Jobs
Multithreading (Windows) Process Creation / Exiting / Termination - - PowerPoint PPT Presentation
BS1 WS19/20 topic-based slides Multithreading (Windows) Process Creation / Exiting / Termination Comparison between UNIX and Windows Thread Creation / Termination / Suspending / Resuming Fibers Jobs Processing API: Windows
BS1 WS19/20 – topic-based slides
Operating Systems 16
Operating Systems 17
Operating Systems 18
Operating Systems 19
VOID ExitProcess( UINT uExitCode); BOOL TerminateProcess( HANDLE hProcess, UINT uExitCode); BOOL GetExitCodeProcess( HANDLE hProcess, LPDWORD lpExitCode);
Operating Systems 20
Operating Systems 22
Operating Systems 23
DWORD WINAPI ThreadFunc(LPVOID) HANDLE CreateThread ( LPSECURITY_ATTRIBUTES lpsa, DWORD cbStack, LPTHREAD_START_ROUTINE lpStartAddr, LPVOID lpvThreadParm, DWORD fdwCreate, LPDWORD lpIDThread)
Operating Systems 24
BOOL GetExitCodeThread ( HANDLE hThread, LPDWORD lpdwExitCode) VOID ExitThread( DWORD devExitCode )
Operating Systems 25
DWORD ResumeThread (HANDLE hThread) DWORD SuspendThread(HANDLE hThread)
Operating Systems 27
–
stack
–
fjber-local storage
–
some registers (essentially those saved and restored for a procedure call)
–
cooperatively “scheduled” within the thread
Operating Systems 28
process or thread system call
–
E.g. length of thread time slice
–
Processes created by processes in a job automatically are part of the job
– Unless restricted, processes can “break away” from a job
–
Examples on next slide…
Operating Systems 29
can run on
–
Not acquire administrative privileges
–
Not accessing windows outside the job, no reading/writing the clipboard
timeslice (or quantum)
–
E.g. can be used to achieve “class scheduling” (partition CPU)
Operating Systems 30
– SU from NT4 ResKit didn’t do this