multithreading - Threads (Operating Systems) definition clarification -
edit: clarification of definition based on read. it's different other questions because "basic unit of cpu utilization"
i taking operating systems class @ university , started learning threads.
a thread (based on read in textbook "operating systems concepts") described "basic unit of cpu utilization". mean if "basic unit of cpu utilization"
does mean cpu executes thread or threads belonging process opposed "executing process itself"?
a thread stream of instructions execution.the reason having threads (ada "tasks") able multiple things @ same time (or should 1 way of doing multiple things @ same time.
you multiple things @ same time having multiple programs running @ same time (the traditional unix method). reason having threads allow faster data exchange. threads in same process can share same address space allowing data exchanges through memory (albeit, requires implementing synchronization). languages, such ada, incorporate safe mechanisms threads exchange data. languages, however, programmer implement safe methods threads change data.
the answer question depends upon implementation. there 2 ways of implementing thread.
1: threads implemented in library linked application. library uses timers interrupt application , switch among thread.
in model, operating system knows absolutely nothing threads. thread entirely creation of process itself.
in method, 1 thread @ time within process executes (interleaved execution).
2: operating system implements threads. threads scheduled execution operating system.
in model process consists of address space shared 1 or more threads. in multiprocessor system, threads of process can execute in parallel.
the difference between 2 models above in #1, process basic unit of scheduling. operating schedules processes execution , process shifts between threads. process schedules threads execution.
in #2, thread basic unit of scheduling operating system. when thread executed, operating system must load process address space well.
-=-=-=-=-=-=-=-=-=-=-=-=-=
take read in "operating systems concepts" grain of salt. "basic unit of cpu utilization" total bs concept. book invents concepts have no relation reality.
Comments
Post a Comment