{"action":"created","issue":{"url":"https://api.github.com/repos/sctplab/usrsctp/issues/37","labels_url":"https://api.github.com/repos/sctplab/usrsctp/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/sctplab/usrsctp/issues/37/comments","events_url":"https://api.github.com/repos/sctplab/usrsctp/issues/37/events","html_url":"https://github.com/sctplab/usrsctp/issues/37","id":118466012,"number":37,"title":"If usrsctp thread safe?","user":{"login":"ibc","id":16191,"avatar_url":"https://avatars.githubusercontent.com/u/16191?v=3","gravatar_id":"","url":"https://api.github.com/users/ibc","html_url":"https://github.com/ibc","followers_url":"https://api.github.com/users/ibc/followers","following_url":"https://api.github.com/users/ibc/following{/other_user}","gists_url":"https://api.github.com/users/ibc/gists{/gist_id}","starred_url":"https://api.github.com/users/ibc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibc/subscriptions","organizations_url":"https://api.github.com/users/ibc/orgs","repos_url":"https://api.github.com/users/ibc/repos","events_url":"https://api.github.com/users/ibc/events{/privacy}","received_events_url":"https://api.github.com/users/ibc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sctplab/usrsctp/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-23T20:31:35Z","updated_at":"2015-11-27T19:49:02Z","closed_at":"2015-11-24T16:52:53Z","body":"In other words: I've a multi-thread app which runs N threads (each one running a [libuv](https://github.com/libuv/libuv) events loop for UDP/TCP etc), and I want to add `usrsctp` on top of it.\r\n\r\nCan I safely call `usrsctp_init()` on the main thread (which runs before all the others are created) and use this lib within the other threads?\r\n\r\nTo be clear: each thread manages its own UDP/TCP connections.\r\n\r\nThanks a lot."},"comment":{"url":"https://api.github.com/repos/sctplab/usrsctp/issues/comments/160195419","html_url":"https://github.com/sctplab/usrsctp/issues/37#issuecomment-160195419","issue_url":"https://api.github.com/repos/sctplab/usrsctp/issues/37","id":160195419,"user":{"login":"ccaughie","id":7458913,"avatar_url":"https://avatars.githubusercontent.com/u/7458913?v=3","gravatar_id":"","url":"https://api.github.com/users/ccaughie","html_url":"https://github.com/ccaughie","followers_url":"https://api.github.com/users/ccaughie/followers","following_url":"https://api.github.com/users/ccaughie/following{/other_user}","gists_url":"https://api.github.com/users/ccaughie/gists{/gist_id}","starred_url":"https://api.github.com/users/ccaughie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccaughie/subscriptions","organizations_url":"https://api.github.com/users/ccaughie/orgs","repos_url":"https://api.github.com/users/ccaughie/repos","events_url":"https://api.github.com/users/ccaughie/events{/privacy}","received_events_url":"https://api.github.com/users/ccaughie/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T19:49:02Z","updated_at":"2015-11-27T19:49:02Z","body":"Yes, the application calls the timer routine on an interval timer. I call it every 10 milliseconds just like the built in timer thread does.\r\n\r\nMultiple instances of usrsctp in a single process is well beyond the scope of what I've done I'm afraid. Currently there is a lot of global state in the library; this would all have to be moved into a struct so that you could create multiple copies of it."}}