{"action":"created","issue":{"url":"https://api.github.com/repos/CrispOSS/jabs/issues/25","repository_url":"https://api.github.com/repos/CrispOSS/jabs","labels_url":"https://api.github.com/repos/CrispOSS/jabs/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/CrispOSS/jabs/issues/25/comments","events_url":"https://api.github.com/repos/CrispOSS/jabs/issues/25/events","html_url":"https://github.com/CrispOSS/jabs/issues/25","id":146541154,"number":25,"title":"Thread safety of LocalNotary","user":{"login":"peteryhwong","id":6159311,"avatar_url":"https://avatars.githubusercontent.com/u/6159311?v=3","gravatar_id":"","url":"https://api.github.com/users/peteryhwong","html_url":"https://github.com/peteryhwong","followers_url":"https://api.github.com/users/peteryhwong/followers","following_url":"https://api.github.com/users/peteryhwong/following{/other_user}","gists_url":"https://api.github.com/users/peteryhwong/gists{/gist_id}","starred_url":"https://api.github.com/users/peteryhwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteryhwong/subscriptions","organizations_url":"https://api.github.com/users/peteryhwong/orgs","repos_url":"https://api.github.com/users/peteryhwong/repos","events_url":"https://api.github.com/users/peteryhwong/events{/privacy}","received_events_url":"https://api.github.com/users/peteryhwong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-04-07T08:08:25Z","updated_at":"2016-08-03T14:46:16Z","closed_at":null,"body":"Looking at https://github.com/CrispOSS/abs-api-parent/blob/master/abs-api/src/main/java/abs/api/LocalNotary.java#L21, I was wondering if IdentityHashMap needs to be threadsafe if it is used in conjunction with a ConcurrentMap."},"comment":{"url":"https://api.github.com/repos/CrispOSS/jabs/issues/comments/237258106","html_url":"https://github.com/CrispOSS/jabs/issues/25#issuecomment-237258106","issue_url":"https://api.github.com/repos/CrispOSS/jabs/issues/25","id":237258106,"user":{"login":"nobeh","id":1003027,"avatar_url":"https://avatars.githubusercontent.com/u/1003027?v=3","gravatar_id":"","url":"https://api.github.com/users/nobeh","html_url":"https://github.com/nobeh","followers_url":"https://api.github.com/users/nobeh/followers","following_url":"https://api.github.com/users/nobeh/following{/other_user}","gists_url":"https://api.github.com/users/nobeh/gists{/gist_id}","starred_url":"https://api.github.com/users/nobeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nobeh/subscriptions","organizations_url":"https://api.github.com/users/nobeh/orgs","repos_url":"https://api.github.com/users/nobeh/repos","events_url":"https://api.github.com/users/nobeh/events{/privacy}","received_events_url":"https://api.github.com/users/nobeh/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T14:46:16Z","updated_at":"2016-08-03T14:46:16Z","body":"I tried to come up with a minimal code to try to produce `ConcurrentModificationException` on `IdentityHashMap`. Does this look good?\r\n\r\n```java\r\npublic static void main(String[] args) {\r\n\tfinal IdentityHashMap<Object, Reference> ids = new IdentityHashMap<>();\r\n\tRunnable modifier = new Runnable() {\r\n\t\t@Override\r\n\t\tpublic void run() {\r\n\t\t\tString thread = Thread.currentThread().getName();\r\n\t\t\tNumberFormat nf = NumberFormat.getNumberInstance();\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tids.put(new Object(), Reference.from(UUID.randomUUID().toString()));\r\n\t\t\t\t\tSystem.out.println(thread + \" -> size=\" + nf.format(ids.size()));\r\n\t\t\t\t} catch (ConcurrentModificationException e) {\r\n\t\t\t\t\tSystem.err.println(\"Concurrent modification: \" + thread + \" >>> \" + e);\r\n\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tIntStream.rangeClosed(1, Runtime.getRuntime().availableProcessors())\r\n\t\t.mapToObj(i -> new Thread(modifier, \"t-\" + i))\r\n\t\t.forEach(t -> t.start());\r\n\ttry {\r\n\t\tThread.sleep(10000);\r\n\t} catch (Throwable e) {\r\n\t\tSystem.err.println(\"Execution stopped: \" + e);\r\n\t}\r\n\tSystem.exit(0);\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"nobeh"}}