C ++ kwiLinux, isihloko sivuselelwa emva kweminyaka emi-6

Linux C++

Ukusetyenziswa kwe-C++ kwiLinux kucetywe kwakhona

Kubonakala ngathi ukwaziswa kweRust njengolwimi lwesibini Inkqubo kwiLinux Kernel imele enye yezona nguqu zibalulekileyo ukuba iLinux ibenayo kwaye ingathethi kuluhlu lweempawu kunye nokusebenza, kodwa iphawule isiqalo esibaluleke kakhulu kwindlela uLinus Torvalds kunye neqela lophuhliso bathathe inyathelo elibalulekileyo ekuphuculeni iLinux ibe ngcono.

Oku kunokuqatshelwa, kuba mva nje, kuluhlu lokuposa lwe-kernel ye-Linux ingxoxo iye yavuselelwa eyaqalwa kwiminyaka emithandathu eyadlulayo, ngokuqhula sibonisa umhla woku-1 kuTshazimpuzi ka-2018.

Kwaye ibekwe kwakhona etafileni. umba "wokubanakho ukwamkela ikhowudi ye-C ++ yangoku kwi-Linux kernel", ukuya ngaphaya kokusetyenziswa kwendabuko yolwimi lwe-C kunye neziqwenga zokuhlanganisa kunye nokukhuthazwa kolwimi lweRust.

Isiphakamiso sokuqala sasungulwa ngo-2018, yinjineli ye-Red Hat njengesiqhulo kubhiyozo owaziwayo ka-Epreli wobudenge, apho abaninzi bathatha ithuba lokudala i-pranks kuluntu kwaye ngelo xesha kwaba njalo, ekubeni kwakuthiwe ikhuphe iseti ye-45 patches ebandakanya ukusetyenziswa kweetemplates, ilifa leklasi kunye ukulayishwa ngokugqithisileyo kwemisebenzi yeC++.

Ngokombono wam, i-C ++ 14 yinguqulo "encinci" enenkxaso ye-metaprogramming enengqiqo kwaye ineninzi ngaphandle kweentlobo kwiinguqulelo zangaphambili (i-C ++ 11 yayininzi, kodwa i-C ++ 14 igcwalisa ezinye iziqwenga eziphambili ezingekhoyo). Nangona kunjalo, ngokombono wam, i-C ++ 20 ngenene inguqu enkulu yomdlalo; Nangona iinguqulelo zangaphambili zinokusebenzisa iihacks ezininzi zeSFINAE, zikwanike imiyalezo yempazamo engenamsebenzi.

Senza uninzi lwemetaprogramming kwiLinux kernel, ephunyezwe kusetyenziswa amaqhinga amakhro amabi kakhulu. Ezi nazo azinakwenzeka ukuzilungisa. Makhe sithathe umzekelo weehacks zohlobo lwe-uaccess.h, ezinye zazo endiziyile ndaza ndazibhala. Kwi-C ++, ii-casts ezahlukeneyo kunye neengxelo zetyala zinokwahlulwa zibe ziimeko zetemplate ezahlukileyo, kwaye ngobukrelekrele obuncinci, izinto ezifana nezikhombisi ze-userspace ngokuchasene ne-kernel userspace pointers zinokunyanzeliswa ngokungqongqo, kunye nezalathisi esele ziphawulwe, ngokuchasene nezo zingekhoyo, singasathethi ke ngokuphathwa lula kwemeko ye32-bit yeentlobo zesithuba somsebenzisi kwi-64-bit kernel kunye nokusetyenziswa koguqulelo endian.

Ngoku phantse emva kweminyaka emi-6 yale nto, uHans Peter Anvin, umphuhlisi ophambili we-Intel kernel kunye nomdali weeprojekthi ezifana ne-syslinux, i-klibc kunye ne-LANANA, uye wathabatha inyathelo lokuqala lokuqhubeka nengxoxo. Ngokutsho kuka-Anvin, ukususela ngo-1999, iilwimi ze-C kunye ne-C ++ ziye zabona inkqubela phambili enkulu ekuphuhlisweni kwazo, kwaye ulwimi lwe-C ++ lubonakalise ukuba lufanelekile ngakumbi kune-C kuphuhliso lwe-kernel yenkqubo.

Anvin ikhankanya ukuba iimpawu ebezifuna ulwandiso oluthile ngaphambili ukusuka kwi-GCC, ngoku inokuphunyezwa ngokulula kumgangatho weC++, kwaye kwiimeko ezininzi, ukusebenzisa i-C ++ kuya kuphucula isiseko ngaphandle kokufuna ukutshintsha ngokupheleleyo ikhowudi.

Ukongeza kuyo, Kucetywa ukuba kusetyenziswe ubuncinci inkcazo ye-C++ 14, okubandakanya izixhobo ze-metaprogramming, kunye nokusetyenziswa kwenkcazo ye-C ++ ye-20 iyakhuthazwa, eyazisa inkxaso yeengcamango ezinokunciphisa iziganeko zeempazamo.

Kuxoxwa ukuba i-C ++ ikhethwa ngakumbi kuneRust, kuba le yokugqibela yahluke kakhulu kwi-syntax esuka kulwimi lwe-C, ayiqhelekanga kubaphuhlisi be-kernel bangoku kwaye ayikuvumeli ukubhalwa kwakhona kwekhowudi ngokuthe ngcembe. Kwimeko yolwimi lwe-C ++, kunokwenzeka ukuguqulela iinxalenye zekhowudi yolwimi ngokuthe ngcembe, ngokufana nendlela ikhowudi ye-C enokuqulunqwa ngayo njengeC ++.

Ngelixa i-Linux kernel ngokuyintloko ikhowudi ye-C enamalungu ahlukeneyo abhalwe kwindibano kunye nomsebenzi okhulayo ojikeleze inkxaso yeRust kwi-Linux kernel, akukacaci ukuba kukho ubunzima obaneleyo boku ukuba yinyani, kumathuba okubona ikhowudi ye-Linux ye-kernel. iguqulelwe kwi-C++ kwixesha elizayo.

ekugqibeleni ukuba ukhona unomdla wokwazi ngakumbi ngayo, ungazijonga iinkcukacha kwi ukulandela ikhonkco.


Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Inoxanduva lwedatha: I-AB Internet Networks 2008 SL
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.