{"action":"created","issue":{"url":"https://api.github.com/repos/hbrands/jira-import-test/issues/25","repository_url":"https://api.github.com/repos/hbrands/jira-import-test","labels_url":"https://api.github.com/repos/hbrands/jira-import-test/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/hbrands/jira-import-test/issues/25/comments","events_url":"https://api.github.com/repos/hbrands/jira-import-test/issues/25/events","html_url":"https://github.com/hbrands/jira-import-test/issues/25","id":168518137,"number":25,"title":"CompositeList not thread-safe","user":{"login":"hbrands","id":7273079,"avatar_url":"https://avatars.githubusercontent.com/u/7273079?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrands","html_url":"https://github.com/hbrands","followers_url":"https://api.github.com/users/hbrands/followers","following_url":"https://api.github.com/users/hbrands/following{/other_user}","gists_url":"https://api.github.com/users/hbrands/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrands/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrands/subscriptions","organizations_url":"https://api.github.com/users/hbrands/orgs","repos_url":"https://api.github.com/users/hbrands/repos","events_url":"https://api.github.com/users/hbrands/events{/privacy}","received_events_url":"https://api.github.com/users/hbrands/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hbrands/jira-import-test/labels/www","name":"www","color":"b6a77e"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hbrands/jira-import-test/milestones/3","html_url":"https://github.com/hbrands/jira-import-test/milestones/milestone%201","labels_url":"https://api.github.com/repos/hbrands/jira-import-test/milestones/3/labels","id":1913975,"number":3,"title":"milestone 1","description":null,"creator":{"login":"hbrands","id":7273079,"avatar_url":"https://avatars.githubusercontent.com/u/7273079?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrands","html_url":"https://github.com/hbrands","followers_url":"https://api.github.com/users/hbrands/followers","following_url":"https://api.github.com/users/hbrands/following{/other_user}","gists_url":"https://api.github.com/users/hbrands/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrands/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrands/subscriptions","organizations_url":"https://api.github.com/users/hbrands/orgs","repos_url":"https://api.github.com/users/hbrands/repos","events_url":"https://api.github.com/users/hbrands/events{/privacy}","received_events_url":"https://api.github.com/users/hbrands/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":25,"state":"open","created_at":"2016-07-31T13:32:30Z","updated_at":"2016-07-31T13:37:30Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-07-31T13:37:29Z","updated_at":"2016-07-31T13:37:38Z","closed_at":"2016-07-31T13:37:30Z","body":"<p>Glazed Lists' new CompositeList combines multiple event lists into one.</p>\n\n<p>This class is not thread-safe. In particular, it may be possible to cause a deadlock when one thread is <br/>\nreading the CompositeList while another thread is writing a list that the CompositeList is composed of.</p>\n<i>[GLAZEDLISTS-25] created by jessewilson at Fri, 19 Mar 2004 15:44:50 +0100, resolved Mon, 19 Jul 2004 16:36:51 +0200</i>"},"comment":{"url":"https://api.github.com/repos/hbrands/jira-import-test/issues/comments/236430325","html_url":"https://github.com/hbrands/jira-import-test/issues/25#issuecomment-236430325","issue_url":"https://api.github.com/repos/hbrands/jira-import-test/issues/25","id":236430325,"user":{"login":"hbrands","id":7273079,"avatar_url":"https://avatars.githubusercontent.com/u/7273079?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrands","html_url":"https://github.com/hbrands","followers_url":"https://api.github.com/users/hbrands/followers","following_url":"https://api.github.com/users/hbrands/following{/other_user}","gists_url":"https://api.github.com/users/hbrands/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrands/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrands/subscriptions","organizations_url":"https://api.github.com/users/hbrands/orgs","repos_url":"https://api.github.com/users/hbrands/repos","events_url":"https://api.github.com/users/hbrands/events{/privacy}","received_events_url":"https://api.github.com/users/hbrands/received_events","type":"User","site_admin":false},"created_at":"2016-07-31T13:37:38Z","updated_at":"2016-07-31T13:37:38Z","body":"<p>After implementing my proposed solution, I tested it and discovered that it was<br/>\nfailing miserably! The solution has a problem that prevents it from being<br/>\nacceptable. The notifying thread must have a write lock on the entire list to<br/>\nprevent changes from being made while the listChanged() method is being handled<br/>\nby listeners. This is requirement #2 and it is not satisfied by that proposal.<br/>\nTherefore the proposal is insufficient.</p>\n\n<p>Therefore I propose a new solution, somewhat of a hybrid between the two.<br/>\ni. Read lock on composite list obtains the read locks of all source lists in<br/>\narbitrary order<br/>\nii. Write lock on composite list is a special ReadWriteLock called<br/>\n\"PropagateLock\" plus the read locks of all source lists.<br/>\niii. Upon a change notification in the composite list, that thread tests if the<br/>\npropagateLock is locked. If it is, it leaves its changes to be propogated by the<br/>\nthread that currently owns the propogate lock. If that lock is unlocked, the<br/>\nthread takes the propogate lock and then all read locks in arbitrary order. It<br/>\nthen concatenates its own changes with any changes left while it was collecting<br/>\nlocks. Finally it propagates the concatenated change while holding the propogate<br/>\nlock, read locks to all source lists, and the original write lock for one source<br/>\nlist.</p>\n\n<p>This combined lock includes the \"writer lock\" for this list, satisfying<br/>\nrequirement #1. <br/>\nThe reader lock is a hybrid lock that holds all other read locks, preventing<br/>\nchanges while reading. This satisfies requirement #2.<br/>\nThe reader locks need not be mutex with one another so that solves part of #3.<br/>\nFor writer locks, a thread's 2nd lock is always the propogate lock, and it fails<br/>\nif that lock is not available immediately, solving another part of #3. Finally,<br/>\nno thread acquires write locks after owning a first read lock, finishing up the<br/>\nfinal area of concern for requirement #3.</p>\n<i>jessewilson Thu, 10 Jun 2004 18:27:35 +0200</i>"}}
{"actor":{"display_login":"hbrands"}}