{"action":"created","issue":{"url":"https://api.github.com/repos/TokTok/toxcore/issues/14","repository_url":"https://api.github.com/repos/TokTok/toxcore","labels_url":"https://api.github.com/repos/TokTok/toxcore/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/TokTok/toxcore/issues/14/comments","events_url":"https://api.github.com/repos/TokTok/toxcore/issues/14/events","html_url":"https://github.com/TokTok/toxcore/issues/14","id":165158118,"number":14,"title":"Reconsider the use of pthread","user":{"login":"iphydf","id":10647936,"avatar_url":"https://avatars.githubusercontent.com/u/10647936?v=3","gravatar_id":"","url":"https://api.github.com/users/iphydf","html_url":"https://github.com/iphydf","followers_url":"https://api.github.com/users/iphydf/followers","following_url":"https://api.github.com/users/iphydf/following{/other_user}","gists_url":"https://api.github.com/users/iphydf/gists{/gist_id}","starred_url":"https://api.github.com/users/iphydf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iphydf/subscriptions","organizations_url":"https://api.github.com/users/iphydf/orgs","repos_url":"https://api.github.com/users/iphydf/repos","events_url":"https://api.github.com/users/iphydf/events{/privacy}","received_events_url":"https://api.github.com/users/iphydf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"GrayHatter","id":243408,"avatar_url":"https://avatars.githubusercontent.com/u/243408?v=3","gravatar_id":"","url":"https://api.github.com/users/GrayHatter","html_url":"https://github.com/GrayHatter","followers_url":"https://api.github.com/users/GrayHatter/followers","following_url":"https://api.github.com/users/GrayHatter/following{/other_user}","gists_url":"https://api.github.com/users/GrayHatter/gists{/gist_id}","starred_url":"https://api.github.com/users/GrayHatter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrayHatter/subscriptions","organizations_url":"https://api.github.com/users/GrayHatter/orgs","repos_url":"https://api.github.com/users/GrayHatter/repos","events_url":"https://api.github.com/users/GrayHatter/events{/privacy}","received_events_url":"https://api.github.com/users/GrayHatter/received_events","type":"User","site_admin":false},"assignees":[{"login":"GrayHatter","id":243408,"avatar_url":"https://avatars.githubusercontent.com/u/243408?v=3","gravatar_id":"","url":"https://api.github.com/users/GrayHatter","html_url":"https://github.com/GrayHatter","followers_url":"https://api.github.com/users/GrayHatter/followers","following_url":"https://api.github.com/users/GrayHatter/following{/other_user}","gists_url":"https://api.github.com/users/GrayHatter/gists{/gist_id}","starred_url":"https://api.github.com/users/GrayHatter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrayHatter/subscriptions","organizations_url":"https://api.github.com/users/GrayHatter/orgs","repos_url":"https://api.github.com/users/GrayHatter/repos","events_url":"https://api.github.com/users/GrayHatter/events{/privacy}","received_events_url":"https://api.github.com/users/GrayHatter/received_events","type":"User","site_admin":false},{"login":"JFreegman","id":1646057,"avatar_url":"https://avatars.githubusercontent.com/u/1646057?v=3","gravatar_id":"","url":"https://api.github.com/users/JFreegman","html_url":"https://github.com/JFreegman","followers_url":"https://api.github.com/users/JFreegman/followers","following_url":"https://api.github.com/users/JFreegman/following{/other_user}","gists_url":"https://api.github.com/users/JFreegman/gists{/gist_id}","starred_url":"https://api.github.com/users/JFreegman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JFreegman/subscriptions","organizations_url":"https://api.github.com/users/JFreegman/orgs","repos_url":"https://api.github.com/users/JFreegman/repos","events_url":"https://api.github.com/users/JFreegman/events{/privacy}","received_events_url":"https://api.github.com/users/JFreegman/received_events","type":"User","site_admin":false},{"login":"irungentoo","id":2226611,"avatar_url":"https://avatars.githubusercontent.com/u/2226611?v=3","gravatar_id":"","url":"https://api.github.com/users/irungentoo","html_url":"https://github.com/irungentoo","followers_url":"https://api.github.com/users/irungentoo/followers","following_url":"https://api.github.com/users/irungentoo/following{/other_user}","gists_url":"https://api.github.com/users/irungentoo/gists{/gist_id}","starred_url":"https://api.github.com/users/irungentoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irungentoo/subscriptions","organizations_url":"https://api.github.com/users/irungentoo/orgs","repos_url":"https://api.github.com/users/irungentoo/repos","events_url":"https://api.github.com/users/irungentoo/events{/privacy}","received_events_url":"https://api.github.com/users/irungentoo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-07-12T19:18:57Z","updated_at":"2016-07-12T19:25:18Z","closed_at":null,"body":"The toxcore library uses `pthread_mutex_*` functions in net_crypto. I wonder why it does that, given that the public API is not supposed to be thread-safe. I'd argue that not being thread-safe is a desirable feature, because it greatly simplifies the implementation by not having to deal with locking. If a client wants to use multiple threads to access a single tox instance, it can do its own locking around the calls (tox4j does this internally, so in Java you won't see it).\r\n\r\nIs there any reason for having mutex locks inside toxcore if we can assume no concurrent calls to public API functions? If not, I would like to see all uses of pthread functions removed."},"comment":{"url":"https://api.github.com/repos/TokTok/toxcore/issues/comments/232152423","html_url":"https://github.com/TokTok/toxcore/issues/14#issuecomment-232152423","issue_url":"https://api.github.com/repos/TokTok/toxcore/issues/14","id":232152423,"user":{"login":"zetok","id":3148759,"avatar_url":"https://avatars.githubusercontent.com/u/3148759?v=3","gravatar_id":"","url":"https://api.github.com/users/zetok","html_url":"https://github.com/zetok","followers_url":"https://api.github.com/users/zetok/followers","following_url":"https://api.github.com/users/zetok/following{/other_user}","gists_url":"https://api.github.com/users/zetok/gists{/gist_id}","starred_url":"https://api.github.com/users/zetok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetok/subscriptions","organizations_url":"https://api.github.com/users/zetok/orgs","repos_url":"https://api.github.com/users/zetok/repos","events_url":"https://api.github.com/users/zetok/events{/privacy}","received_events_url":"https://api.github.com/users/zetok/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T19:25:18Z","updated_at":"2016-07-12T19:25:18Z","body":">I wonder why it does that, given that the public API is not supposed to be thread-safe.\r\n\r\nIsn't that because of libsodium `init()` which should not be run concurrently, and toxcore just makes sure that this is the case regardless of what client does?\r\n\r\nNo idea what the code in question does, but toxcore does the crypto initiation in network ,and the module where you have this thing is called `net_crypto`.."}}
{"actor":{"display_login":"zetok"}}