Example: confidence

10 Things Every Linux Programmer Should Know

ResearchLabsLinuxKernelWorkshop, March2004 aboutUserspacevs. kernelspaceMemory allocationProcessesvs. threadsNPTL- Native POSIXT hreadsLibraryOptimizationUsetherightabst ractionlayerforthejobWhy codingstyleis importantWhy youshouldalwayscheck forerrorsTherealcostof softwaredevelopmentPortabilityLinuxKerne lWorkshop, March2004 aboutThistalkis aboutcommonmisconceptions, andthingsIthinkevery aboutlearningfromotherpeople abouthow to s aboutknowinghow thingswork; Knowinghowthingswork opinions, andmineonly. Feelfreeto .LinuxKernelWorkshop, March2004 processis executingeitherin userspace, orin kernelspace. Dependingonwhichpriviledges, addressspaceandaddress(EIP)a processis executingin,we saythatit is eitherin userspace, userspace, a processhasnormalpriviledgesandcanandcan tdocertainthings.

think every Linux programmer should know. This talk is about learning from other people’s experience and mistakes. This talk is about how to write better software. It’s about knowing how things work; Knowing how things work lets us embrace and extend Linux.

Tags:

  Linux, Should, Programmer, Know, Every, Things, Every linux programmer should know, 10 things every linux programmer should know

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of 10 Things Every Linux Programmer Should Know

1 ResearchLabsLinuxKernelWorkshop, March2004 aboutUserspacevs. kernelspaceMemory allocationProcessesvs. threadsNPTL- Native POSIXT hreadsLibraryOptimizationUsetherightabst ractionlayerforthejobWhy codingstyleis importantWhy youshouldalwayscheck forerrorsTherealcostof softwaredevelopmentPortabilityLinuxKerne lWorkshop, March2004 aboutThistalkis aboutcommonmisconceptions, andthingsIthinkevery aboutlearningfromotherpeople abouthow to s aboutknowinghow thingswork; Knowinghowthingswork opinions, andmineonly. Feelfreeto .LinuxKernelWorkshop, March2004 processis executingeitherin userspace, orin kernelspace. Dependingonwhichpriviledges, addressspaceandaddress(EIP)a processis executingin,we saythatit is eitherin userspace, userspace, a processhasnormalpriviledgesandcanandcan tdocertainthings.

2 Whenexecutingin kernelspace, a processhaseverypriviledge, , suchasprocessesusingiopl().Thebiggestdif ferencebetweenuserspaceandkernelspaceis conceptual-theprogrammer s stateof , March2004 a library function,implementedin thestandardC library. It isnota implementedby two meansin thebrk()systemcall,whichgrowsa process s mapping/dev/zeroto getanonymousmemory. In bothcases, virtualmemory areafortheapplication,but doesnotallocatephysicalmemory accessedphysicalmemory knownas memory overcommit ,andtherearewaysto disable ()reallytooslow foryou?LinuxKernelWorkshop, March2004 Linux , thatthreadssharethesamevirtualmemory level interfaceto createthreadsis theclone() interfaceispthread_create().Context switchesbetweenprocessesin better, multiprocessormultithreaded? 1-1 ,not 1-N or M-N.

3 Linuxthreadinglibrariesevolution:LinuxTh reads,NGPT, is part of gilbc, programmerinterfaceis , March2004 Native POSIXT hreadsLibraryTheNew POSIXT hreadsLibrary, writtenby UlrichDrepperandIngoMolnarof RedHat, thedesignandimplementationof places, (FastUserspaceMutexes).Standardin , andback portedto , , March2004 :"Prematureoptimizationis therootof allevil".Avoidthedesireto optimize prematurely;concentrateongettingit s timeto optimize, profile, profile, profile. Thedesireto searchforthecoinunderthestreetlight isstrong, algorithmsfirst, s (almost) fastis Therearelibraries, backgroundprocesses, thekernel, , March2004 a highlevel language, low levellanguage, objectoriented,functional,logicprogrammi ngorprocedural language?whichcanexpresstheproblemdomain best?Balancebetweenthedesireto learn new toolsandtechniquesandtheneedto sureyouhave several hammers, but don tdisdaina hammerjustbecauseyou ve ::open(),fopen(),open()orint0x80?

4 LinuxKernelWorkshop, March2004 codingstyleis importantYourcodedoesnotbelongto eyesmake allbugsshallow, but if noonecanunderstandyourcode, noonewilllookat s plentyof roomforpersonalexpressionevenwhenusingso meoneelse s thecompiler s Burn it if youwant,but follow , March2004 youshouldalwayscheckforerrorsAnythingtha tcangowrong, s yourresponsibilityto dothebestjobyoucan,andthatincludeshandli ngerrors. It s thethingyoudon texpectto there s nothingto bedonewhenanerroroccures,yourdesignis probably , leave acommentforthenext programmerto very sanitychecks- youwantto catchtheerrorascloseaspossible to whereit printf()andclose().Bevery wary of any stringfunctionthatdoesn ttake , March2004 oftenhave peoplegoonusingthattenlinerscriptyouwrot eyearago?how oftendidit become production ? missioncritical ?

5 There s away to thepeoplewhowillreadit few yearslaterit mightbeyou,andyou llappreciateevery , , March2004 tcostyou,withinreason,andcansave youtime, money andeffort s platform is tomorrow s garbage. Platformsandoperatingenvironmentschange, youmustdosomethingplatform-specific, abstractitwellin itsowninterchangeable a goodoneis ttry to abstractthatwhichis , March2004 ,Answers,Comments?Whatdoyouthinkevery Linuxprogrammershouldknow?LinuxKernelWor kshop, March2004


Related search queries