{"action":"opened","issue":{"url":"https://api.github.com/repos/iu-parfunc/adaptive-data/issues/5","labels_url":"https://api.github.com/repos/iu-parfunc/adaptive-data/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/iu-parfunc/adaptive-data/issues/5/comments","events_url":"https://api.github.com/repos/iu-parfunc/adaptive-data/issues/5/events","html_url":"https://github.com/iu-parfunc/adaptive-data/issues/5","id":107297278,"number":5,"title":"For later on: either better concurrent bag or get rid of Pure/Scalable distinction.","user":{"login":"rrnewton","id":274582,"avatar_url":"https://avatars.githubusercontent.com/u/274582?v=3","gravatar_id":"","url":"https://api.github.com/users/rrnewton","html_url":"https://github.com/rrnewton","followers_url":"https://api.github.com/users/rrnewton/followers","following_url":"https://api.github.com/users/rrnewton/following{/other_user}","gists_url":"https://api.github.com/users/rrnewton/gists{/gist_id}","starred_url":"https://api.github.com/users/rrnewton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrnewton/subscriptions","organizations_url":"https://api.github.com/users/rrnewton/orgs","repos_url":"https://api.github.com/users/rrnewton/repos","events_url":"https://api.github.com/users/rrnewton/events{/privacy}","received_events_url":"https://api.github.com/users/rrnewton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-18T23:57:40Z","updated_at":"2015-09-18T23:57:40Z","closed_at":null,"body":"Here's the thing, if we had a best-in-class concurrent bag, then the pure version and the scalable version would be very very different in terms of heap representation.\r\n\r\nBut right now, our relatively simple \"scalable\" bag is just `P` copies of the pure bag!  As long as that is the case it is not really necessary to have a separate Pure/Scalable copy.  (This strategy would make more sense in the Data.Map vs concurrent skiplist case.)\r\n\r\nWith our simplified bag we could avoid going all the way back to the Pure representation and instead just use the first slot of the array as the only list.  (Or we could use the other slots only as needed based on contention.  I'm sure there's an algorithm for this somewhere in the literature.  The other slots serve as an elimination structure for the first slot.)\r\n\r\nThere's a large design space here.  Also, I think there are some opportunities to use simple ring-buffer queues in the concurrent bag setting (which, with a single producer thread and single consumer, don't need an atomic operation per add/remove at all).  \r\n\r\n"}}