I have been looking for ways to share data between imps running the same code.
Within the electric imp ecosystem, this is not possible at the moment, but you can use an external web service, or your own server, to keep the shared data for you.
I looked at xively.com as a means to do that. Ideally you would use triggers to notify other imps of any changes, so there is no need for polling the data feed for new data. However, I did not succeed in creating triggers using the xively API, although it should be possible, as documented on https://xively.com/dev/docs/api/metadata/triggers/create_trigger/.
I either get a 401 Not Authorized or a 500 Internal Server Error response, depending on which API key I use.
As an alternative, I created a solution which uses the feed’s tags to allow each imp to notify other imps. After connecting, each imp adds a tag to the feed with its agent id, which is part of the agent URL. After an imp updates a datastream, it reads the tags, and uses the agent ids to notify other imps of the new data. This works quite well, although the latency is quite large: about a second. So compared with polling, the advantage is not that great.
In my example code, there is a switch on pin1 and a LED on pin2 of each imp. Pressing the switch on any imp will toggle its own LED, and convey the LED state to the other imps. Code is here: https://gist.github.com/marcboon/5634981