-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounded spaces #12
Comments
This sounds neat. I like this :) |
No objections, only questions:
@albertolluch
Given the discussion in #5, I have a few suggestions. For describing a bounded space by tuple count, one could define a bounded space as follows:
For an unbounded space, then:
In my opinion, by default, For bounded spaces (and in tight environments where this could be useful: small IoT devices, sensor networks, ensembles etc.) one could see the use of a capacity strategy. Imagine the following case: a sensor network in a remote area, and where one wants to avoid deadlocks and in exchange accept loss of information. Initialisation for each node in such a network could be:
This initialises a bounded space of capacity of 1024 tuples, and when full, will drop tuples on non-blocking operations that add more tuples to the space. Any semantics of blocking operations are not changed by Default As of current writing, I am not aware of small embedded systems that could host any of the current Space API implementations, and therefore I do not see a reason to have a strategy to drop data as default via a @albertolluch @michele-loreti @sequenze What do you think? |
thanks @luhac, interesting ideas.
For now only tuple count, to adhere to well-understood notions of bounded channels. In the future we may considering more sophisticated notions.
It is not part of the core API.
This is a very interesting idea to pursue in the future. It would require to study first a clean formalisation. In sum, I propose that for now we stick to a simple notion of bounded space based on number of tuples that can be stored. As I said, this has the unique advantage of being able to use model checking tools for modelling and verification. |
The formal semantics of bounded spaces is now specified here: https://github.com/pSpaces/Programming-with-Spaces/blob/master/semantics.md We should mark here which implementations do not (yet) supporting bounds. https://github.com/pSpaces/Programming-with-Spaces/blob/master/naming.md |
All spaces classes we provide have unbounded capacity. I propose we consider a parameter to optionally make them of bounded capacity.
Bounded spaces have several applications (e.g. devices with limited resources, too fast producers that need to be contained...) and can make things easier (even decidable) for verification (e.g. Spin/Promela channels are bounded channels).
In a bounded space, the
put
operation blocks if the space is full.@michele-loreti @sequenze @luhac objections?
PS. For capacity 1 all spaces would have the same behaviour.
PS2. One could even consider capacity 0 implement synchronous rendezvous: queries always fail, put and get synchronise. But, for now, capacity > 0 is all I propose.
The text was updated successfully, but these errors were encountered: