1/3/16

Petri Nets & Randezvous Concurrency, an Idiom.

Introduction.

... just had an insight about Petri Nets for Concurrency & Tasks' Randezvous combined together.

... this is a simple musing & experimenting with ideas, but probably will stay in one form or another.


Tasks with Objects.

we wish to model Interleaving Tasks as Actions with Object(s).

one Object can be aggregate, contain many objects - thus a Task might have many objects that are involved in that a Task.


Tokens as Preconditions.

Token accumulation might be a seen as precondition(s) accumulation for a Task to go past a certain 'wait' stage(s), a signal that something occured.

When a Token is in queue it signifies that a certain precondition associated with that queue is met.

When enough of tokens/preconditions are ready to be consumed, event is fired & a Task can proceed to next Wait Stage or a Randezvous Point.

How to ensure that there can be one token in a queue at most? By adding another queue back to originator object - only one token can be in either go forward queue or in return queue.


Syntax.

i think that there might be a nice syntax in 'Ola AH' Programming Language for defining:
- Tasks' 'Wait Stages' with 'Token Queues',
- 'Randezvous Points' with 'Token Queues' & 'Task(s) to meet'.


Example.

we have Fighter Jet software, with Task 1 & Task 2 among other parts.

Task 1: Loading Ammunition ... it's a complex process that lasts continuously & has a 'Randezvous Point' where it has to wait for barrel to be ready for load.
Task 2: Shooting ... it's again a complex process with a Randezvous Point where it waits for ammo to be loaded.

when the Tasks meet, Task 1 can transfer data objects to Task 2 & both can proceed after a Randezvous.

what's the difference between 'Wait Stage' & 'Randezvous Point' ? with 'Randezvous Point' data is transferred between Tasks, with 'Wait Stages' we only note that certain precondition(s) is/are met.


see also, if You wish or need, ... : 'Ola AH' Programming Language Randezvous System, Petri Nets.

No comments:

Post a Comment