H-BACI - A PPENDIX H BACI T HE B E N ARI C O N C U R R E N...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
A A PPENDIX PPENDIX H H BACI: T BACI: T HE HE B B E N E N - A - A RI RI C C O N C U R R E N T O N C U R R E N T P P ROGRAMMING ROGRAMMING S S Y S T E M Y S T E M 1 By Bill Bynum, College of William and Mary Tracy Camp, Colorado School of Mines H.1 INTRODUCTION ............................................................................................................... 2 H.2 BACI ................................................................................................................................... 2 System Overview ........................................................................................................... 2 Concurrency Constructs in BACI .................................................................................. 3 cobegin ............................................................................................................... 3 Semaphores ........................................................................................................ 4 Monitors ............................................................................................................. 4 Other Concurrency Constructs ........................................................................... 5 How to Obtain BACI ..................................................................................................... 5 H.3 EXAMPLES OF BACI PROGRAMS ................................................................................ 5 H.4 BACI PROJECTS ............................................................................................................... 9 Implementation of Synchronization Primitives ........................................................... 10 Implementation of Machine Instructions ......................................................... 10 Implementation of Fair Semaphores (FIFO) .................................................... 10 Semaphores, Monitors, and Implementations .............................................................. 10 A's and B's and Semaphores ............................................................................ 10 Using Binary Semaphores ................................................................................ 11 Busy Waiting versus Semaphores .................................................................... 11 Semaphores and Monitors ................................................................................ 11 General and Binary Semaphores ...................................................................... 12 Time Ticks: A Monitor Project ........................................................................ 12 A Problem of a Popular Baker ......................................................................... 12 H.5 ENHANCEMENTS TO THE BACI SYSTEM ................................................................ 12 Supplement to Operating Systems: Internals and Design Principles, Sixth Edition William Stallings Prentice Hall 2008 ISBN-10: 0-13-600632-9 ISBN-13: 978-0-13-600632-9 http://williamstallings.com/OS/OS6e.html 1 This work was supported in part by National Science Foundation (NSF) Grant NCR- 9702449.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
H-2 H.1 INTRODUCTION In Chapter 5, concurrency concepts are introduced (e.g., mutual exclusion and the critical section problem) and synchronization techniques are proposed (e.g., semaphores, monitors, and message passing). Deadlock and starvation issues for concurrent programs are discussed in Chapter 6. Due to the increasing emphasis on parallel and distributed computing, understanding concurrency and synchronization is more necessary than ever. To obtain a thorough understanding of these concepts, practical experience writing concurrent programs is needed. Three options exist for this desired “hands-on" experience. First, we can write concurrent programs with an established concurrent programming language such as Concurrent Pascal, Modula, Ada, or the SR Programming Language. To experiment with a variety of synchronization techniques, however, we must learn the syntax of many concurrent programming languages. Second, we can write concurrent programs using system calls in an operating system such as UNIX. It is easy, however, to be distracted from the goal of understanding concurrent programming by the details and peculiarities of a particular operating system (e.g., details of the semaphore system calls in UNIX). Lastly, we can write concurrent programs with a language developed specifically for giving experience with concurrency concepts such as the Ben-Ari Concurrent Interpreter (BACI) [BYNU96]. Using such a language offers a variety of synchronization techniques with a syntax that is usually familiar. Languages developed specifically for giving experience with concurrency concepts are the best option to obtain the desired hands-on experience.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern