
asthir (computer prograaming)

computer prograaming mein, asthir kaa arth haye kii ack moolya samay key saath kuchh code key niyantran key baahar badalane kii sambhavana haye. asthirta kaa prabhaav function colling convention key bheetar padata haye, aur yeh bhee prabhaavit kartaa haye kii charr kaise sangraheet kiye jaate hain, axes kiye jaate hain aur kaish kiye jaate hain.
see, see + +, see #aur jaava prograaming bhaashaon mein, asthir mukhya shabd ingit kartaa haye kii vibhinn abhigamon key beach ack moolya badal sakata haye, bhale hii yeh sanshodhit naheen dikhaai detaa hoe. yeh mukhya shabd ack anukoolan compiler koo baad mein padhane yaa likhane key liye anukoolit karane seey rokta haye aur iss prakaar ack puraane moolya kaa galat tareeke seey punah upayog yaa likhane koo chhod detaa haye. asthir moolya mukhya roop seey hardware pahunch (memori-mapped aaee/oh) mein utpann hotey hain, jahaan paridhiya upkaranon key saath samvaad karane key liye padhane yaa memori mein likhane kaa upayog kiya jaataa haye, aur threading mein, jahaan ack alag dhaage ney ack moolya koo sanshodhit kiya hoe sakata haye.
ack samanya mukhya shabd honey key bavjood, cock _ 1 kaa vyavhaar prograaming bhaashaon key beach kaafee bhinn hotaa haye, aur aasaani seey galat samajha jaataa haye. see aur see + + mein, yeh ack prakaar kaa yogyata haye, jaise kii cock _ 2, aur "prakaar" kii sampatti haye. isake alawa, see aur see + + mein yeh adhikansh threading paridrishyon mein "kaam naheen kartaa" haye, aur usa upayog koo hatotsaahit kiya jaataa haye. jaava aur see #mein, yeh ack charr kii sampatti haye aur ingit kartaa haye kii jiss vastu seey charr bandha haye vaha utparivartit hoe sakata haye, aur vishesh roop seey threading key liye abhipret haye. dee prograaming bhasha mein, threading upayog key liye ack alag mukhya shabd cock _ 3 haye, lekin koee cock _ 1 mukhya shabd maujood naheen haye.
see aur see + + mein.
see mein, aur parinamswarup see + +, cock _ 1 mukhya shabd kaa uddeshya thaah
choonki asthir key roop mein chihnit charr code key maanak pravaah key baahar badalane key liye pravan hotey hain, isaliye sankalak koo code dwara ingit charr parr harr padhane aur likhane kaa pradarshan karna hotaa haye. asthir charon taka kissy bhee pahunch koo anukoolit naheen kiya jaa sakata haye, jaise.jee. madhyavarti moolyon key bhandaran key liye rajistaron kaa upayog karke. 
jabaki see aur see + + donon dwara abhipret, see maanak yeh vyakt karane mein whiffle rahate hain kii cock _ 1 shabdarth moolya koo sandarbhit karate hain, naa kii sandarbhit vastu koo. sambandhit dosh report "dow 476" (see11 key liye) abhee bhee see17 key saath sameeksha key adheen haye.
cock _ 1 charr parr sanchaalan paramanu naheen hain, naa hii way threading key liye sambandh seey pahale ack uchit ghatana sthaapit karate hain. yeh praasangik manakon (see, see + +, posics, winn 32) mein nirdisht haye, aur vartamaan karyanvayan key vishal bahumat mein asthir charr surakshit naheen hain. iss prakaar, ack portable synchronization tantra key roop mein cock _ 1 mukhya shabd kaa upayog kaee see/see + + samoohon dwara hatotsaahit kiya jaataa haye.
see mein smriti-maanchitrit aaee/oh kaa udaaharan.
iss udaaharan mein, code kokwe _ 12 mein sangraheet moolya kokwe _ 13 parr sett kartaa haye. yeh taba taka baar-baar usa moolya koo matdan karna shuru curr detaa haye jaba taka kii yeh kokwe _ 14 mein naheen badal jaataa haih
sthir int phoo;
shoonya baar (shoonya) {
 foo = 0;
 jabaki (phoo!= 255)
ack anukoolan compiler yeh dekhega kii koee anya code sambhavatah cock _ 12 mein sangraheet moolya koo badal naheen sakata haye, aur yeh maan legaa kii yeh harr samay cock _ 13 key barabar rahega. isaliye sankalak iss prakaar key ack anant loop key saath kaary nikaay koo pratisthaapit karegaah
shoonya baar anukoolit (shoonya) {
 foo = 0;
 jabaki (sach)
haalaanki, cock _ 12 ack aise sthaan kaa pratinidhitva curr sakata haye jise computer system key anya tatvon dwara kissy bhee samay badala jaa sakata haye, jaise kii cpu seey judey upkaran kaa hardware register. uparokt code kabhi bhee iss tarah key parivartan kaa pataa naheen lagaayega; cock _ 1 mukhya shabd key binaa, sankalak yeh maanata haye kii vartamaan prograam pranali kaa ekmatra hissa haye joe moolya koo badal sakata haye (joe abb taka kii sabse aam sthiti haye).
compiler koo uparokt code koo anukoolit karane seey rokane key liye, cock _ 1 mukhya shabd kaa upayog kiya jaataa haih
sthir asthir int phoo;
shoonya baar (shoonya) {
 foo = 0;
 jabaki (phoo!= 255)
iss sanshodhan key saath loop kii sthiti anukoolit naheen hogi, aur jaba yeh hotaa haye tou system parivartan kaa pataa lagaayega.
aam taur parr, platforms parr upalabdh smriti baadha sanchaalan (joe see + + 11 mein ujagar hotey hain) hain jinhen asthir key bajaay pasand kiya jaanaa chaahiye kyonki way sankalak koo behtar anukoolan karane kii anumati dete hain aur adhik mahatvapurna roop seey way bahu-threaded paridrishyon mein sahee vyavhaar kii guaranti dete hain; naa tou see vinirdesh (see11 seey pahale) aur naa hii see + + vinirdesh (see + + 11 seey pahale) ack bahu-threaded memori model koo nirdisht kartaa haye, isaliye asthir oss/compiler/cpus mein nirdhaarak roop seey vyavhaar naheen curr sakata haye.
see mein anukoolan tulanaa.
nimnalikhit see prograam, aur saath mein assembler bhasha key ansh, pradarshit karate hain kii kaise cock _ 1 mukhya shabd sankalak key output koo prabhaavit kartaa haye. iss mamle mein sankalak jee. see. see. thaa.
assembly code kaa avalokan karate samay, yeh spasht roop seey dikhaai detaa haye kii cock _ 1 vastuon key saath utpann code adhik verbose haye, jisase yeh lamba hoe jaataa haye taaki cock _ 1 vastuon kii prakriti koo puuraa kiya jaa sakey. cock _ 1 mukhya shabd sankalak koo asthir vastuon seey judey code parr anukoolan karane seey rokta haye, iss prakaar yeh sunishchit kartaa haye kii pratyek asthir charr assignment aur reed mein ack sambandhit smriti pahunch haye. cock _ 1 mukhya shabd key binaa, sankalak koo pataa haye kii pratyek upayog mein memori seey ack charr koo phir seey padhane kii aavashyakta naheen haye, kyonki kissy anya dhaage yaa prakriya seey isake memori sthaan parr koee lekhan naheen honah chaahiye.
see + + 11.
see + + 11 iso maanak key anusaar, asthir mukhya shabd kewal hardware pahunch key liye upayog key liye haye; iska upayog antar-paath sanchaar key liye naa karein. antar-paath sanchaar key liye, maanak pustakalaya cock _ 25 template pradaan kartaa haye.
jaava mein.
jaava prograaming bhasha mein bhee cock _ 1 mukhya shabd haye, lekin iska upayog kuchh alag uddeshya key liye kiya jaataa haye. jaba ack kshetra mein lagu kiya jaataa haye, tou jaava qualifier cock _ 1 nimnalikhit guaranti pradaan kartaa haih
cock _ 1 kaa upayog taalaa kii tulanaa mein tej hoe sakata haye, lekin yeh jaava 5 seey pahale kuchh sthitiyon mein kaam naheen karega. jaava 5 mein asthir prabhaav vaali sthitiyon kii seema kaa vistaar kiya gayaa thaa; vishesh roop seey, double-check locking abb sahee dhang seey kaam karati haye.
see #mein.
see #mein, cocksey _ 1 yeh sunishchit kartaa haye kii kshetra taka pahunchane vaalaa code kuchh dhaage-asurakshit anukoolan key adheen naheen haye joe sankalak, see. ell. aar. yaa hardware dwara kiya jaa sakata haye. jaba ack kshetra koo cock _ 1 chihnit kiya jaataa haye, tou sankalak koo isake chaaron or ack "smriti baadha" yaa "baad" utpann karane kaa nirdesh diyaa jaataa haye, joe kshetra seey bandhe nirdesh punarnirdharan yaa cashing koo rokta haye. jaba ack cock _ 1 kshetra koo padhaa jaataa haye, tou sankalak ack "adhigrahan-baad" utpann kartaa haye, joe anya dhaage sahit anya koo kshetra mein padhane aur likhane seey rokta haye, baad seey pahale "sthanantarit honey seey. jaba ack cockie _ 1 kshetra mein likhaa jaataa haye, tou sankalak ack "release-baad" utpann kartaa haye; yeh baad anya koo padhane aur likhane seey rokti haye joe baad key baad kshetra mein sthanantarit honey seey rokti haye.
kewal nimnalikhit prakaron koo cock _ 1 key roop mein chihnit kiya jaa sakata haih sabhi sandarbh prakaar, cock _ 34, cock _ 35, cock _ 36, cock _ 37, cock _ 38, cock _ 39, cock _ 40, cock _ 41, cock _ 42, aur sabhi ganana kiye gaye prakaar ack antarnihit prakaar key cock _ 36, cock _ 37, cock _ 38, cock _ 39, cock _ 40, yaa cock _ 41 key saath. (isamen moolya sanrachanaon key saath-saath adim prakaar cock _ 49, cock _ 50, cock _ 51 aur cock _ 52 koo shamil naheen kiya gayaa haye.)
cock _ 1 mukhya shabd kaa upayog una kshetron kaa samarthan naheen kartaa haye joe sandarbh dwara paarit kiye jaate hain yaa sthaaniya charon koo pakadate hain; inn mamalon mein, cock _ 54 aur cock _ 55 kaa upayog kiya jaanaa chaahiye.
prabhaav mein, yeye vidhiyaan aamtaur parr see #sankalak, jeet sankalak, yaa cpu dwara kiye gaye kuchh anukoolan koo aksham karati hain. cock 54 aur cock 55 dwara pradaan kii gaee guaranti cock 1 mukhya shabd dwara pradaan kii gaee guaranti kaa ack superset haih "aadhi baad" utpann karane key bajaay (yaani ack adhigrahan-baad kewal nirdesh punarnirdharan aur cashing koo rokti haye joe isase pahale aatee haye), cock 59 aur cock 60 ack "poorna baad" utpann karate hain joe nirdesh punarnirdharan aur donon dishaaon mein usa kshetra key catching koo rokta haye. yeye vidhiyaan nimnanusar kaam karati hainh
cock _ 54 aur cock _ 55 vidhiyaan cock _ 67 vidhi koo coll karke ack poorna baad utpann karati hain, joe ack smriti baadha kaa nirmaan karati haye joe donon dishaaon mein kaam karati haye. oopar dee gaee poorna baad kaa upayog karane kii preranaon key alawa, cock _ 1 mukhya shabd key saath ack sambhaavit samasya joe cock _ 67 dwara utpann poorna baad kaa upayog karke hull kii jaati haye, nimnanusar haih aadhe baad kii asmamit prakriti key kaaran, ack lekhan nirdesh key saath ack cock _ 1 kshetra jisake baad ack padhane key nirdesh key saath abhee bhee sankalak dwara nishpaadan crum koo badala jaa sakata haye. kyonki poorna baad samamit hoti hain, yeh cock _ 67 kaa upayog karate samay koee samasya naheen haye.
kille mein.
cock _ 72 kille 2003 maanak kaa hissa haye, halanki pahale key sanskaran ney ise ack vistaar key roop mein samarthit kiya thaa. ack falan mein sabhi charon koo cock _ 1 banaana bhee upnaamak sambandhi bagon koo dhoondhane mein upayogi haye.
purnank, asthirah: i! jaba asthir koo paribhaashit naheen kiya jaataa haye tou code kii nimnalikhit dou panktiyaan samaan hoti hain.
likhein (*, *) i * * 2! memori seey ack baar charr i koo load karein aur usa moolya koo gunaa karein
likhein (*, *) i * i! memori seey charr i koo dou baar load karein aur una moolyon koo gunaa karein
hamesha ack asthir kii smriti mein "drilling down" karke, kille key sankalak koo vashpasheel koo padhane yaa likhane key liye punah crum seey baahar rakhaa jaataa haye. yeh iss dhaage mein kiye gaye anya dhaage key karyon koo dikhaai detaa haye, aur isake vipareet.
asthir kaa upayog cumm hoe jaataa haye aur anukoolan koo bhee roque sakata haye.