File: process_communication.rst

package info (click to toggle)
python-simpy3 3.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,080 kB
  • sloc: python: 2,885; makefile: 138
file content (32 lines) | stat: -rw-r--r-- 953 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
=====================
Process Communication
=====================

Covers:

- Resources: Store

This example shows how to interconnect simulation model elements together using
"resources.Store" for one-to-one, and many-to-one asynchronous processes. For
one-to-many a simple BroadCastPipe class is constructed from Store.

When Useful:
  When a consumer process does not always wait on a generating process
  and these processes run asynchronously. This example shows how to
  create a buffer and also tell is the consumer process was late
  yielding to the event from a generating process.

  This is also useful when some information needs to be broadcast to
  many receiving processes

  Finally, using pipes can simplify how processes are interconnected to
  each other in a simulation model.

Example By:
  Keith Smith

.. literalinclude:: code/process_communication.py

The simulation's output:

.. literalinclude:: code/process_communication.out