Sie sind auf Seite 1von 19
Onit-8 —>PROCESS: Praga undet execution ls Aacd to be piocers =DSPROCESS STATES: oe he weowise of executdom, processes whange stale: i —7 {he weliperent poasible Afakes Of oo proces vare the foriowing: ¢ rae Ps dle Fhe pHocers Ls Ba enecert ed, by the procendl In Execution: xtowd be executed , but veo thet pHocess + Q Realy: The pHeces® ds sewworently beng executed: 3 Wupended: The puocess is waiting for a Hesowter, fox example It w weatting {ox Jnput/ output £0 forsh- ye Stopped. The process has ben Auspended by ian exlewnet HOCEK: 5 Zombse: The proces has fertahed exteution, but if vy Aleut Hqettneed dn the system: $3: aSJate wbiogsiom of va. pitocess - ===> FUNCTIONS: Pid-t get pid (Void): nelins pHecers id Of adking pnocess - Pid-t getppid (veid Lat Helis patent pae(ers id of vealun process Pid-t getuid (void): af netusind Heal userid’ of the walu'ne pa ecers Pid-t getenid (void): at Hecisins effective uselid cf the veatteng prtocens: g pid-t getegid (Void): Zt Heturms effective g-10up id of the eatin pil (ews : 4 + Pid-t getgia (void)! TH nels gucoup id of Du vealieng precess- ===> Cention of processes: Pregl Pagless os vneated by vending Oo foxke functeon a the curating proces dy vn led parent procers vind — sexeatedl putes dy wtadted vohuid piracess 3. A nae value har 6 value “o'. — Ayrton! . # ulnelude cays [tgpes b> ap unclude ¢ ungtd-P> Pid-b foaK Cues) the above function amreates hic process whet child prcorers 10 is gwen tO he patent von vchild sHemains ruth oO value ~o Con) vt vets a value -1° £0 snauicate edt ca the ware of faclure » fone selves va Value 1, rand the vawable evine has che fovlowing values - Exo Alean'y EAGAIN “the mawimum Rambert of processes for tre sewnnemt usety COT) Lo fhe system » has been steached * ENoMEM = he Kernel has not been able fo allocate emouigh momoxy to uueati another precers: ot Progam: He snclutcle X UOINO hy fF tnclude 4 Adon? # indude < untaed b7 Vord marin (vord) pid-t pid pid = forked ah (pid== 1) peut (Co fon’) elacaf (pid =0) puntt (“Tom ine whi: pid © yd In" Prd elye putt (OZ om the patents pid « xd \n", pid yy j ==) TERMINATION OF CURRENT PROCESS: A piocess vom be forminated normale ol abnox mally . 4 —7 Nowmal termination of paecess:s Teg] pro cers 4s Auucl to be term(nated nonmally , if ) Td exerees we Heltutn Aatemenk in the funetoon. ny at vtolla Le ent) functions , Hus flushes Zhu bupfert and then wemuns Lo the Kernel: mb veils the -exkO funcion , thes fun aion umm egcatel yetuing FO the Ketnel wsthout psig TAL bole 27 Abnowmat feimenation af process: 1 el process ia gard To be feinuinated obnoamatly Lif 2) at vaily the abet function whith genrates the signal v SIGABRT wae nece’ver veectacn aegmals that 4foxce ut £0 .teinchation adyntart #ancude Vounl- eure [aint Atal ); He indude ented > 4 Sid b> Vord ewe Cant Stats) => waiting fort the dermination of a vhudl puocers: v 1 A process may wart for the fexmination of a shud pH oles by watng the prinutiver wat and waitpid sbyntor: geanclude ¢ Atgs] Types: M> , Heanielude < Mys] wart > pide work Cane # sfaltis)) pid-t roaltpid (Pid-E Pid, sink xtatus , Int options The psimilive wort suspends execution of Lhe worert process until a vhuid paces has terminated - if va thisd paocevs has abveo ly Fexminated, watt 4edunrs die éimmedtratiy « The primitive weikpid suspends execution of Ihe wwetert spacers urtist Phe uhild proces specified by Lhe parameter pid termunates: AO athvid process ees01 sponding to pid has abreaoly terminated + wartpid seCWins The He yult din ediatety => Cevelopment with fener —7 phases of xcempal ation page png’) [wompitex | prigsS (Fisembiex] je [Howceaiton] | Enecutable voce: ‘hae wompulation of a vecde AFarts wath “cl vtede wand ends wwth exectutebse “ode ! prleprtoce ning: me preprocessing step is pefoumed by a “pte tom vealed cpp: i Q& veempiiation’ qe eompslation wep ia pertfesrmedt by a | } pregstom walled eee ; elasemblex: The assembUing Afep és performed by , progam vealed ag y- penkedcton: The sinucng sfep Ls perfosrmect by va program waued td ==> Pbuwetene cf Lnur pile system Jbins Ghe bin vakinvectore Aboney Vall evectitable files) [boet: Tt untludes startup ples: Joleus der stands for adevicess snput weeiers vand eulput sdleueces yrotertivek pUtcs vane Atomect under thd seer fried (1-e wleitloocy q \ Joke: Hose ampoxkant system wenyiguorabion duos are vn yy ulin. ( ab montana home adisiertorses of dhe temman (ves | home Jeo: be sed, fon preva AM! ihe heuony funthord pe plus) vi, seq) by Ine unit prroyromrn2s wy yo dy TL adlsvertony [dri Joan: patles the were saith d vate A tot found reuonectonty slung Parlecies f aan | z qa Le | steg 3) 2 | 1 falls § ~ | | ali nat P| | \E g (s | = \ ' ile 2 3) )ul|, 5 3 |2 \ i a}ivl | Sl ollBHEls iS rie sala lea ene Jront: mone 7 wourt: Slandand mount post fon extemal fue system fx: cdo, fleppy [rret: yt ancludes verweus nretaccrue prtetecats Jope: at wenrarna extia vind sh partly software [proc A ventual fle syéerd seontanty infoxmatcon aboct Aystem Hesowices « Ghe fue” pitec- but explacns the vixntial fue system anidetatl > { boot: The veidmeniAbrative wives neme velectony. | obin: ea aaa fori Use by the Aystem sand sytem ad mint sbiator | Ewp: Alt the Sa files ether weHeated by user ol by the unl operating aysiem atseef cee placerl tinder Hurd sdisiectony. Au the feles of thts aduitectoxy gets deleted automatically when even the Agstem Ahiutdowns Vatt ptovage fox wit Vewable 40es and Lem panasy fetes veto tect by usetd Auth as tog feles, Apace fort fem pony akonoge of flo wWotontooded fan Lhe apreinet etc, fuser s glue eset Helated programs Avch a) Lebyauty sdotumentation ;progvams ,ebe-» Schedeting The Schedule ig “the Keane}. ~funclton lich decides, tohich Peocess should. be executed by ste Psecessos * athe schedules scans “the bal of Processes in “the deady ctate ond Uses several caitesia “to choose tehich Process “to execute . sThese ase 3 types of Processos echedating “ey ane login mediim team and Shodt “tesrt scheduling « “To advert muttipragsamening , acheduling To “the “6 clement. ochedsling| OPPies “te bSth alo devices Gnd CPUs scheduling in Viner hod 3 gPesert Policies processes, Evert Process han Maced Puely , Nostable Process Pe - “The Wyre oF Procesnes ase + fos nosmal and wealline Paiowity and “the M eched_ Fife Q@ sener_ eR QQ sxved— oTHER SCHED - FIFO . D_RIFO becomes easy y “Ht Ye execitted. a Peocess of “the tye ecke giale the pectess oT the > her Teaediately The schedsles kaghest and exeattes Ths IL wot Tatensust its execution excert in» Suolions? DA Process oF echED Figo KYPE having highes psinsity becomes sendy, and “her A i execited: d “The Process. FHS ousPended while eaniiting “Tes nthe Priosity, The Peotess wil ever lie Ve os oP J the process tallingl_ leave “he Primitive, ScHED_NIELD - pectessos due to O call te the. NEDA > when a Process oF “the WyPe GCHED RR becomes rh exeatted, Jmmedistely{ « > SCHED -RR is Same A eched - FIFO excepl “Thal wher o Proters is exectted, O time alal 6 gitvibated “to ‘Tt SCHED GIHER, “The ockedaling, Policy exerdtes “this Peocess When “ihe ‘Cealkime Psotess is net Presait tn weady Sltte In wendy Tis Pessonalities —_> Pesoorality ia a mechaniom guPpasted by linus oyster which allows “the Pooguams belonging “te thes ehesnting system “fo be: in in tinue + ase coaigred +o On execution domain + —> All “the Psoce sees tetto Signal ackions. —> Execution domain ‘tell linux PH moony sheases on “the following , haw “fo MAP Spal Nambers ) Merenge numbers ofeetied by Pecesnes mesnone numbess “tit Owe afeciHed BY O Pocess One. the help of — look-up “table - 9 Convested arte number oF masoiys Resunsded “Yo yacesses went “b O Peocesa, The mensn gt lock-up “table + Wher. mmesonyye te rte be umbels fo conested bY TEAMS Fo 2 pte cate expster cate (suck as oy5tern intersufls) vod by Tose sto charge. the ok ot te Kesel mode + mode clo ~The peoceso oF creating, duplicate cory oF clonings “The Created. Peocese 15 Vrux using Clone Command: tate a Feahrse ot shasing) nts cthe Pasert Psxess 6 called as called as ‘Clone’. A clone Process Con be Created in The Present cloning Psocees Forti contest oth Te parent Proces® + eae ner one os mere farts of “the pasenl contest Gee atheted 9 otter? == Addeeso SPace : Pb code Ons gat is showed Tr addeess sPace , Sindilos, segrent o between “Heo vie. ches hoe oy modikicatton made by one Peocess eailt be visible File oyster Cotteel efoumalion Fre Same edt and camsent dineresies Coe chased between MANY PSECERS+ Ary, moaditication done “te one disectogy ebREle “he athens « Ofer Pile Descuiptos showed batdeen multiple Prcce sveS= The Some Pert sy a File ig closed by Om ek the Protec then tt comnat be acessed + by cthes. Peocess Tderkties snes | psceesse cam hove the 2OMme. numbed + “the standasd oom of “the clone “Function To 08 Follows t __—— wat clone (*# wane, Noid * chit §catoen , Wet at Reap * vat ros eo] 5 The Pavameles “Ir ig O Pontes Som the “child process to “the Loven to be exeeatted.- zone of remy) alwotted. 3 The Ramamates chald- stack to & pointes to the Rog the stock oF child peacesd + JeXines method Jos cloning: es the nombes oY ongument> sto be Pageed. To J The Pasametes So¥e 3 “The pasametes masgp ste fonction Pr een constertte Qekined We “the heades le alow aonb 17 de Fine’ mearin’ consiont CLaNE -NM athe child PECeSS Shaves Whe —qaleese opore Nes sthe — Pasert PRcesd = CLONE _ FS the child Pmces> ehaves wat and curgserl gredodes atte THe posenl Peace CLONE - FILES she child Press haves “the fer He JeaceiPtes> ith the foxert PSOCERS clone — PD “he child Paces rag “the came wumbes as the Posent Psocess- Signals :- “ee Every Sf h ery Stgnat has a Symbolic name starting with SiG, The Signat Names ave defined in the heodes file which must be included by any ‘e' progam that uses Segrale- > Signals ane nothing but antossupting the process: each signet hag an Mteqes numbes that wepretents CHR, --) 08 etl as Ayrobotte name fey Usually detined fn the heades 4 - file luse linc tude Ls¢qnat-h 5 using the command = * itu-4" to see a fst of Signet Supposted by oud System: Signal ] Deseotptton te Sle ABRT £ process abost — & SiG ALRM Lb alarm clock 3B SIG CHLD | chtid Teomtnated, Stopped Lor) continued 4: SIG CONT + Execution conttnued = ff = Stop 5: Stq FPE - Eews tn peithretic — opevation A+ tn division by ae70 6 S16 HOP on contvolting teorirel i L Harg up the Signal Mtg AL Gpvontd hoad use qngrsuction attention Signal BSIGINT Gnteoo ctive 4 sig KILL aminated to» SIG PIPE ee on a PE with 10 reader's He 8tG OCTT + Gntesactive teamt nation: Qe SIG SEQV | gnvauid memory Retevence- 13» SIG STOP i Execution stopped wm SIG TERM | qeamtredion Is slq THIN 1 packground proces? atternpting | to yead 16 Siq Trevr Iq TTOU Backgwound — pwocess attempting to covite L | 13+ Stq URG | um + High bandwidth deta avatiable at a Socket 4 Uses defined — Signal ere | User detined Gingrel two — | LB SIQUSRE 14+ SUG USR2 | ce ee en Signal Handling &- A Sigrat ds a softecave Inteoourpt which es an aynchsonous event it Gan occus at any ttre: > Every Sfgrat hos a unique name stg nert, SIGALRMeC ave the examples of Signals- > then a Stgnal occu the Kernel pesicom one of the Fotrowing actfon: I Gk Ggnoves the fgnar a peotooms the default atton amociated wstth the Signal 3+ catchcesdhandle the Signal by detining a (ger detined function: > The signat functfon te used to fnstatt the Signal handled: Syntars sie Ht inc tude wotd *SignakCint — Signo, votd(* hondlesycint )) Cint)s ws, The Signal function taxes tuo argument’ ie» & Signo a Handler 5 The Signal numbeo fg the name of the Sfgnal SIGAIRM, gignsRt defined [n the heads {tle < signal h> 3 the handles FS & pointes to a uses deftned Signal handles function: 16 Siq Trevr Iq TTOU Backgwound — pwocess attempting to covite L | 13+ Stq URG | um + High bandwidth deta avatiable at a Socket 4 Uses defined — Signal ere | User detined Gingrel two — | LB SIQUSRE 14+ SUG USR2 | ce ee en Signal Handling &- A Sigrat ds a softecave Inteoourpt which es an aynchsonous event it Gan occus at any ttre: > Every Sfgrat hos a unique name stg nert, SIGALRMeC ave the examples of Signals- > then a Stgnal occu the Kernel pesicom one of the Fotrowing actfon: I Gk Ggnoves the fgnar a peotooms the default atton amociated wstth the Signal 3+ catchcesdhandle the Signal by detining a (ger detined function: > The signat functfon te used to fnstatt the Signal handled: Syntars sie Ht inc tude wotd *SignakCint — Signo, votd(* hondlesycint )) Cint)s ws, The Signal function taxes tuo argument’ ie» & Signo a Handler 5 The Signal numbeo fg the name of the Sfgnal SIGAIRM, gignsRt defined [n the heads {tle < signal h> 3 the handles FS & pointes to a uses deftned Signal handles function: Nor + tots functfon takes = Signak = numbes as torre avgumant yetusns vyotd as a vxetusn type and > the handles argument takes different vatuee as Mentioned __betoco |. value Meaning b Stq-IGN Lgnove the Signal the two sfgnals alge. - and sigstop Cannot — be Agno ved 2+ SIG—DEL on | peotooms the default action [3- Addvess oF | Sfgrat handler cat the Stgrot handles: + on success the signal function peluans a peintea to the prewtous Sigrrt handea for a Signat othenwlse dt petusns an — eyrwr etth a vatue SlIG- ERR proguam: trinctude < Signals h> votd — mytardtesint) 5 Ix Sfgnal handes fox Statte tnt — main vold) Siqnt Signal #] g Signal CSIQINL MY Handles); ) * anstatiation of .Stgrat handles * ) Rfopat CSIGTERM, SIG-DFLIs Signor ( SIGSEGV, SIG-IGN) 5 pauses | t ualt for a Stgrat Gntevsuption * | & Static veld my Handles int Stg) 3 printf Cr Recerved SIGINT Signal‘); eetuans 7 kill and Raise -functfonss- The protestos communicates with eachothes by senting Stgnals. The Kil and waise dystem calls ave used to send Signal blo pre cesser- >The RIO system cat Lends a Signal fo a process Cov) process group's > the vaisecd system cou fs used by a process to Send a Cfqnal to ctketf Syntax s =——— 4g include< sys] types: h> H includes sgnck- hs fnt KEL Cpid-t — ptd , int Slg-no); Int vatse Cint — Sfg-no); > roth the Kft and paige System calle geturn's Zero on qutcess and ~4 On CvvOs 3 Here the argument — sfg-no #8 the — Cigna numben of a stgnals to be Sent to one ow moe —procesross gratcated by pd prognam + Oe anctude atinclude < Signals h> mind) 2 int pida, pidbs pid a= fook05 if (pida==0) 3 while cy 2 ers pointh (" pida ig a alive") Slee pen) 5 & pid-as fookO) 14 (pid b = =0) oer wohfle C1) * tnt? (" pid b Is alive "5 sleep(d3 KEW (pid a) SI@INT3 [# KYL proves pid a */ paige CS@INT) > Lt KT itseY ie» pid b x] ¥ } I id Use -func tion = Alam and ps tune HON Alarm — tunctfon fe used «by A PROCESS Alaamc) The e times exptoes after a certain to Set a timer: Th numbes of Clocks Seconds - the Keanat Sends the SIGALRM cating process > he default actfor dos the Signal fg to tesmirate ken the tfmes Explaes Signal to te the process Syntox ~ drtnclude unsigned int alam Cunsigned tnt time - in-Secords) 5 the number of Cpt argument f¢ LIGALRM— Sfgne > The tfme - tn- secends gorerds foo the Keane 10 gent the to the calling prowess the Alaom clock ts tuan off gt at's wile {5 ‘o’ there fs onty ene Alarm clock per process paused ‘ The pouseO dunction Sagpends the execution of unttt the —Stgnal_ ts caugnt Catling process > The pause System cau cvtll be ateoted only and a Stgrak tandeo tehern a Sfgnat tg Cough qutuans » othesustse furction rsctuan's - + astth e309 rambey Set tO EINTR Syntax 3 4pincude< untetd: As int pausecrerd) ; Abort) and — SleepO Aunctfons Aboat 0) % Moat oe Ataame and — pause function Can be ured to Gmplement the Sleep dunctton. “he — Abort -funchion conminates a process Abnoarrally Cat the aboot function, process and neves vetuans to the > chen a preless ct terminates the Cattes- <5 The function genesates — SIQAPRT Syntar Abinclude Std i bsh> oid aboot woid); Psogram 3 ap inetude tinclude < Signa h> gt includ e <.stdttb: ho maint) 2 int pids ptd = fevkOs if Cpid ==0) 4 aboot (5 1* abnormal tesminaton of child using abort a] § else a “ point? C" process td vd", pid); % & Sleeper + —~ "The Sleept 4unction Suspends — the caltes for gpectfied number of cpe Seconds Syntax 3 He tctude< Untstd: he the unsigned — tnt Sleep Cunsigned tnt Sees) 5

Das könnte Ihnen auch gefallen