Example: air traffic controller

Evaluation of the Go Programming Language and ... - TUD

Gro er BelegEvaluation of the Go ProgrammingLanguage and Runtime for L4 ReDaniel M ullerTuesday 12thJune, 2012 Technische Universit at DresdenFaculty of Computer ScienceInstitute of Systems ArchitectureChair of Operating SystemsSupervising professor: Prof. Dr. rer. nat. Hermann H Bj orn D Michael RoitzschSelbstst andigkeitserkl arungHiermit erkl are ich, dass ich diese Arbeit selbstst andig erstellt und keine anderen als dieangegebenen Hilfsmittel benutzt , den 12. Juni 2012 Daniel M ullerThe Go Programming Language was developed by Google for the purpose of systemsprogramming making it potentially suitable for usage in microkernel environments likeL4 and work is meant to investigate whether Go can be used to develop services for a microker-nel and to examine if there are differences in component performance and development speed incomparison to traditional development using C/C++.

The Go programming language was developed by Google for the purpose of systems programming making it potentially suitable for usage in microkernel environments like

Tags:

  Programming, Language, The go programming language

Information

Domain:

Source:

Link to this page:

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

Other abuse

Advertisement

Transcription of Evaluation of the Go Programming Language and ... - TUD

1 Gro er BelegEvaluation of the Go ProgrammingLanguage and Runtime for L4 ReDaniel M ullerTuesday 12thJune, 2012 Technische Universit at DresdenFaculty of Computer ScienceInstitute of Systems ArchitectureChair of Operating SystemsSupervising professor: Prof. Dr. rer. nat. Hermann H Bj orn D Michael RoitzschSelbstst andigkeitserkl arungHiermit erkl are ich, dass ich diese Arbeit selbstst andig erstellt und keine anderen als dieangegebenen Hilfsmittel benutzt , den 12. Juni 2012 Daniel M ullerThe Go Programming Language was developed by Google for the purpose of systemsprogramming making it potentially suitable for usage in microkernel environments likeL4 and work is meant to investigate whether Go can be used to develop services for a microker-nel and to examine if there are differences in component performance and development speed incomparison to traditional development using C/C++.

2 The investigation should focus on whetherand how the concepts of Go channels and Go routines can be used for communication betweentasks/processes. The implementation should be generic, but also incorporate platform specificdetails (for instance L4 capabilities and capability mapping).For the Evaluation , an L4 service should be implemented in Go and compared to an .. Structure ..22 State of the .. Routines .. Channels .. Objects .. Gates .. on L4 .. Go Programs .. Interaction .. Work ..123 Design & Objects .. Objects .. Gates .. Thread .. Channels .. of Netchan .. Interface .. Implementations .. Channels .. Channels .. of Channels .. Memory Channels .. Library Modifications .. Channel Implementation.

3 Hook Versions .. Driver .. Cancelation .. Memory Allocation ..444 .. Performance .. Performance .. Size ..495 Conclusion & Work ..53 Glossary55 Bibliography57 VIIIList of command thread can receive commands from numerous Go routines .. process of a SendIpcGate .. process of a RecvIpcGate .. channel approach for L4Go channel implementation .. multiple Go Channels on one L4 IPC channel .. Go Channel has its corresponding L4 IPC channel .. L4Go channel implementation that may suffer from a race condition .. of multiple IPC call operations .. L4 IPC and Go IPC ping-pong performance .. channel and L4Go channel performance ..47 List of approaches for an L4Go channel implementation .. hooks added to the libgo runtime library.

4 Of code of keyboard driver written in Go .. of code of keyboard driver written in C++ ..50 List of Code sample Go program .. , Go routine 1 .. , Go routine 2 .. simple Go keyboard client ..41IX1 MotivationDeveloping drivers and system services for an operating system is a difficult and error-pronetask. This can be attributed to mainly three causes: The low-level nature of the Language that is used for creating this kind of lots of high-level Programming languages are publicly available, the importantones for systems development are C and C++. C and C++ provide the developer with a lotof freedom in what he can do [Li04], which can be both, a curse or a blessing dependingon the programmer s skills and the problem at hand. The emergence of multi-processor and multi-core software that makes use of all of a system s processing units is a tough can be accounted to the Programming models used, which are hard to grasp for pro-grammers and do not provide suitable abstractions in order to make use of concurrencybut still allow for the creation of software that is easily understandable.

5 Therefore, manyerrors can occur, such as allocation and ownership problems between the various execut-ing entities, race conditions, deadlocks and livelocks, and other synchronization issues. The necessity for a good communication mechanism points mentioned above affect many types of systems. Microkernels and microkernelenvironments, which are of particular interest for this work, pose another difficulty overmonolithic ones: Due to their highly compartmentalized nature they are in increased needfor communication between components, , services and other processes. Establishinga convenient communication mechanism, which can be utilized easily for various com-munication tasks, however, is hard and it is difficult to provide an abstraction that suitesall is a high-level Language that tries to approach the aspects mentioned above.

6 It is a safelanguage in the sense that it provides strict type and memory safety. In addition to that, it takescare of deallocation of no longer referenced objects by incorporation of a Garbage Collectorand, thus, releases the programmer from the job of explicit memory management. For commu-nication and concurrency, it provides easy-to-use primitives that allow development of conciseand easily understandable software: Go channels and Go routines, this thesis, I integrate Go into L4Re in order to make it suitable for developing services anddrivers for L4 in a more comfortable and safe way than is possible with traditionallyused systems Programming languages like C and C++.11 IntroductionFurthermore, I will investigate how certain L4 primitives can be integrated into the Language in auser-friendly fashion, as well as how Go channels can be adapted to be useable for an aside, it should be noted that not all of the previously mentioned points can be solvedby the choice of the Programming Language alone.

7 But it is in addition to the system for whichto develop itself the major player to tackle these issues. As a system is already predeterminedfor my work, I will focus on the Language part and leave other factors open for future Document StructureThis work is structured as follows: Chapter 2 gives an overview about the fundamentals that areuseful to understand this thesis. In there, I introduce the Go Programming Language , its basicprinciples and primitives. Subsequently, I cover the L4 microkernel and its L4 Runtime Envi-ronment that provides important services and abstractions, as well as the state of the integrationof Go into L4Re in order to clarify which functionality I can rely upon. The last part of thechapter will compare this work to other work done in this main chapter, chapter 3, exlains the actual integration into L4Re describing what wasimplemented and how it was designed.

8 I first explain the integration of L4 primitives, so calledkernel objects, into Go and will then describe how the utilization of Go channels for inter-process communication was achieved. After that, a sample service which makes use of theadapted Go channels a keyboard driver is evaluate my implementation in chapter 4. First, I analyze the speed of my developed GoIPC gate wrappers and compare it to native L4 IPC performance. The performance of my L4 Gochannel implementation will be evaluated as well. Further, I compare the developed Go driverto a functional equivalent implementation using C++ in terms of lines of 5 concludes my thesis by providing a short summary of my work and provides anoutlook for future work to be done on various related State of the ArtThis chapter explains the basics that are necessary to understand this thesis.

9 The first sectioncovers relevant details of Go and gives a brief introduction into the Language in general. Sectiontwo is about L4, describing the environment in which the work is done. The third section coversmy previous work with regard to Go and L4, explaining some of the porting steps necessaryin order to run Go programs on L4. The last part considers related work on communicationconstructs, the integration of systems development languages into existing environments, aswell as the other direction, , the wrapping of system specific features to utilize them for theprogramming Language of GoThe Go Programming Language [Inc09d] was invented in 2009 by a team of three engineers Robert Griesemer, Rob Pike, and Ken Thompson at Google [Wik11]. It is a compiled andstrictly type-safe Language that is to be used for systems Programming [Inc09c, Inc09d].

10 It hasbuilt-in support for concurrency and provides primitives for synchronization and communica-tion. For comfortable and automated memory management, it also contains a Garbage Go RoutinesGo routinesare the means for providing concurrency. They aim to be very lightweight suchthat large amounts of them can be created in order to make excessive use of concurrency. Thisis achieved by making them userland threads with an initially small and dynamically growingstack, that are entirely managed by the Go runtime. The runtime library also decides which Goroutines to run and multiplexes them to actual operating system routines are created using thegokeyword and can execute arbitrary Go functions. Theexecuted function can have a return value, however, it is not possible to access this return valueby normal means, , it cannot be assigned to a variable.


Related search queries