mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:halw
Date:2011-02-01T23:14:59.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@747 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -4,6 +4,9 @@
|
|||||||
{{beta}}
|
{{beta}}
|
||||||
|
|
||||||
|
|
||||||
|
{{ReviewRequested}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
==Overview==
|
==Overview==
|
||||||
|
|
||||||
@@ -156,7 +159,7 @@ As stated above, when we think of the execution of sequential Eiffel, we tend to
|
|||||||
|
|
||||||
that the feature application of <code>x.f</code> will complete before <code>y.g</code> begins.
|
that the feature application of <code>x.f</code> will complete before <code>y.g</code> begins.
|
||||||
|
|
||||||
In concurrent Eiffel with SCOOP things are different. This is because a particular feature call, <code>x.f</code>, may occur one processor, and the consequent feature application (of feature <code>f</code> to <code>x</code>) may occur on a different processor.
|
In concurrent Eiffel with SCOOP things are different. This is because a particular feature call, <code>x.f</code>, may occur on one processor, and the consequent feature application (of feature <code>f</code> to <code>x</code>) may occur on a different processor.
|
||||||
|
|
||||||
|
|
||||||
{{definition|Synchronous feature call|A feature call in which the execution of the calling client does not proceed until the feature application has completed. }}
|
{{definition|Synchronous feature call|A feature call in which the execution of the calling client does not proceed until the feature application has completed. }}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
[[Property:title|Single-element producer-consumer]]
|
[[Property:title|Single-element producer-consumer]]
|
||||||
[[Property:weight|-15]]
|
[[Property:weight|-15]]
|
||||||
[[Property:uuid|25d3e585-0eb6-efa8-ada9-8ee596df5ada]]
|
[[Property:uuid|25d3e585-0eb6-efa8-ada9-8ee596df5ada]]
|
||||||
The single-element producer-consumer is a variant of the classic [http://en.wikipedia.org/wiki/Producer-consumer_problem producer-consumer] problem. A producer produces products, in this case integers, which are consumed by a consumer. The producer and consumer are managed by separate [[Concurrent Eiffel with SCOOP#Processors|processors]], so their access to
|
=Description=
|
||||||
|
|
||||||
In this case only a single producer and single consumer are created and there is storage for only a single product. So, effectively in this example, the bounded buffer of the classic producer-consumer problem has a size of one and is not a shared resource. Rather, the single product element (in this case, an integer) is held by the producer and provided to the consumer upon request.
|
The single-element producer-consumer is a variant of the classic [http://en.wikipedia.org/wiki/Producer-consumer_problem producer-consumer] problem. A producer produces products, in this case integers, which are consumed by a consumer. The producer and consumer are managed by separate [[Concurrent Eiffel with SCOOP#Processors|processors]], so any access they have to one another must be synchronized through scoop mechanisms.
|
||||||
|
|
||||||
|
=Highlights=
|
||||||
|
|
||||||
|
In the single-element producer-consumer only a single producer and single consumer are created, and there is only storage allowing for a single instance of the product. So, effectively in this example, the bounded buffer of the classic producer-consumer problem has a size of one and is not a shared resource. Rather, the single product element (in this case, an integer) is held by the producer and provided to the consumer upon request.
|
||||||
|
|
||||||
The <code>PRODUCER</code> class interface exposes features <code>make_something</code> in which a product is produced and <code>get_something: INTEGER</code> which allows a consumer to retrieve the latest product, if one is available. Feature <code>has_something: BOOLEAN</code> is the indicator of whether an integer has been produced and is available for consumption.
|
The <code>PRODUCER</code> class interface exposes features <code>make_something</code> in which a product is produced and <code>get_something: INTEGER</code> which allows a consumer to retrieve the latest product, if one is available. Feature <code>has_something: BOOLEAN</code> is the indicator of whether an integer has been produced and is available for consumption.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user