Skip to content
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

RFC : channel(), tspace() and kvspace() #5791

Closed
wants to merge 2 commits into from
Closed

RFC : channel(), tspace() and kvspace() #5791

wants to merge 2 commits into from

Conversation

amitmurthy
Copy link
Contributor

This PR relies on multiple dispatch on the container of the remote object referenced to by a RemoteRef to implement channels, tspaces and kvspaces.

In that sense it is an alternative approach to introducing channels and the like in Julia as compared to #5757

This PR introduces 3 new methods

channel() which returns a RemoteRef to a channel
tspace() which returns a RemoteRef to a tspace, i.e., a tuple space
kvspace() which returns a RemoteRef to a kvspace, i.e., a dict

tspace and kvspace are inspired by http://en.wikipedia.org/wiki/Linda_(coordination_language)

A channel can have a type and length associated with it. put blocks only when full, take only when empty. It is a queue.

A tspace can store tuples, where the first element is a key.
take(rr, key) will block till an element matching key becomes available in the tspace.
The key can be a Regex object, in which case, it blocks till a match is found.
The space itself is a queue so that any match is ordered as a FIFO.
fetch, isready, take all accept a key parameter and the entire tuple is returned.

A kvspace is like a dict, only exact matches are allowed in take and any duplicates in put results in an overwrite.
put is of the form put(rr, key, value).
fetch, isready, take all accept a key parameter and the associated value is returned.

@amitmurthy
Copy link
Contributor Author

Closed in favor of #5817

@amitmurthy amitmurthy closed this Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant