jBACI - Homework 2 | Programming Languages I | COP 4020, Assignments of Programming Languages

Material Type: Assignment; Class: Programming Languages I; Subject: Computer Programming; University: University of Central Florida; Term: Fall 2006;

Typology: Assignments

Pre 2010

Uploaded on 11/08/2009

koofers-user-4f3
koofers-user-4f3 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UCF
School of computer Science
COT 4020: Programming Languages
Fall 2006
Homework 2 (jBACI)
Due on Friday, April 14th by 11:59pm
Instructions
1. Use jBACI to implement the classic producer / consumer
synchronization problem.
2. Your code should support one producer and two or more consumers.
3. The producer and consumers should share a data buffer of size 10 ints .
4. Use binary semaphores to provide mutually exclusive access to the shared
buffer.
5. The following links provide some information / example code for the
producer / consumer problem.
a. http://nob.cs.ucdavis.edu/classes/ecs150-1999-02/Pdf/sync-
problems.pdf
b. http://cs.gmu.edu/cne/modules/ipc/aqua/producer.html
c.
http://java.sun.com/docs/books/tutorial/essential/threads/synchronizati
on.html
d. http://simpy.sourceforge.net/producer_consumer.htm
6. Use jBACI to implement the classic readers / writers problem using
monitors.
7. Your code should support multiple readers and writers. It should take 2 input
arguments which allow the user to specify the number of concurrent readers
and writers.
8. Use monitors to provide mutually exclusive access to the resource.
9. Multiple readers should be able to concurrently access the resource, however,
only one writer at a time should be allowed access.
10. Your solution should avoide both deadlock and starvation of writers.
11. The following links provide some information / example code for the readers /
pf2

Partial preview of the text

Download jBACI - Homework 2 | Programming Languages I | COP 4020 and more Assignments Programming Languages in PDF only on Docsity!

UCF

School of computer Science

COT 4020: Programming Languages

Fall 2006

Homework 2 (jBACI) Due on Friday, April 14th by 11:59pm Instructions

1. Use jBACI to implement the classic producer / consumer

synchronization problem.

  1. Your code should support one producer and two or more consumers.
  2. The producer and consumers should share a data buffer of size 10 ints.
  3. Use binary semaphores to provide mutually exclusive access to the shared buffer.
  4. The following links provide some information / example code for the producer / consumer problem. a. http://nob.cs.ucdavis.edu/classes/ecs150-1999-02/Pdf/sync- problems.pdf b. http://cs.gmu.edu/cne/modules/ipc/aqua/producer.html c. http://java.sun.com/docs/books/tutorial/essential/threads/synchronizati on.html d. http://simpy.sourceforge.net/producer_consumer.htm

6. Use jBACI to implement the classic readers / writers problem using

monitors.

  1. Your code should support multiple readers and writers. It should take 2 input arguments which allow the user to specify the number of concurrent readers and writers.
  2. Use monitors to provide mutually exclusive access to the resource.
  3. Multiple readers should be able to concurrently access the resource, however, only one writer at a time should be allowed access.
  4. Your solution should avoide both deadlock and starvation of writers.
  5. The following links provide some information / example code for the readers /

writers problem. e. http://www-inst.eecs.berkeley.edu/~cs162/sp06/Lectures/lec08- readerwriter.ppt#614,16,Basic Readers/Writers Solution f. http://www.cs.unc.edu/~jeffay/courses/comp142/notes/7-Monitors.pdf