• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access for just £4.99 per month

Bounded Buffer Module

Page
  1. 1
    1
  2. 2
    2
  3. 3
    3
  4. 4
    4
  5. 5
    5
  6. 6
    6
  7. 7
    7
  • Essay length: 1507 words
  • Submitted: 14/01/2005
Share this essay:
University Degree Microbiology

The first 200 words of this essay...

Bounded Buffer Module

A Bounded Buffer is a data store that may hold a finite number of values. It behaves as a first-in first-out queue: values leave in order in which they arrive. We will develop a programming language implementation of a bounded buffer with three operations:

BufferInit - an initialisation

BufferIn, providing input to the buffer

BufferOut, accepting output from the buffer.

We must specify these operations, design , and implement them.

1. Specification

The state of a bounded buffer will include three components:

buffer: a sequences of values

size: the number of values present

maxsize: an indication of the buffer's capacity.

The sequence buffer, and the state itself, will use a generic parameter X to refer to the type of values to be stored:

===Buffer[X]=================

buffer : seq X

size : N

maxsize : N

size = # buffer

size ? maxsize

At initialization, the bounded buffer is empty: buffer is equal to the empty sequence and size is zero:

===BufferInit[X]==============

Buffer'[X]

buffer'=<>

Read more
The above preview is unformatted text

Found what you're looking for?

  • Start learning 29% faster today
  • Over 150,000 essays available
  • Just £4.99 a month

  • "
    Give credit where credit is due Markedbyteachers.com deserve it. Only Website that provides the best service with no doubt. Been using this website for the past 5 years now. Never let me down. Try it!!!
    "
    Waseem Hussain. Biology, Maths, Chemistry, ICT A Level Student.
  • "
    This site has allowed me to gain confidence in my work and obtain the best results, by using the submitted courseworks and essays as guidelines. I thank everyone who has participated in adding their work to it!!
    "
    Sabreena, England. A Level Student. Biology and Chemistry.

Marked by a teacher

This essay has been marked by one of our great teachers. You can read the full teachers notes when you download the essay.

Peer reviewed

This essay has been reviewed by one of our specialist student essay reviewing squad. Read the full review on the essay page.

Peer reviewed

This essay has been reviewed by one of our specialist student essay reviewing squad. Read the full review under the essay preview on this page.