{"action":"created","issue":{"url":"https://api.github.com/repos/chokkan/crfsuite/issues/35","labels_url":"https://api.github.com/repos/chokkan/crfsuite/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/chokkan/crfsuite/issues/35/comments","events_url":"https://api.github.com/repos/chokkan/crfsuite/issues/35/events","html_url":"https://github.com/chokkan/crfsuite/issues/35","id":58143711,"number":35,"title":"CRFsuite cannot tag concurrently","user":{"login":"tavianator","id":1692591,"avatar_url":"https://avatars.githubusercontent.com/u/1692591?v=3","gravatar_id":"","url":"https://api.github.com/users/tavianator","html_url":"https://github.com/tavianator","followers_url":"https://api.github.com/users/tavianator/followers","following_url":"https://api.github.com/users/tavianator/following{/other_user}","gists_url":"https://api.github.com/users/tavianator/gists{/gist_id}","starred_url":"https://api.github.com/users/tavianator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavianator/subscriptions","organizations_url":"https://api.github.com/users/tavianator/orgs","repos_url":"https://api.github.com/users/tavianator/repos","events_url":"https://api.github.com/users/tavianator/events{/privacy}","received_events_url":"https://api.github.com/users/tavianator/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T23:06:21Z","updated_at":"2016-01-25T05:38:45Z","closed_at":"2016-01-25T05:33:08Z","body":"CRFsuite uses a single tagger instance per model, created [here](https://github.com/chokkan/crfsuite/blob/556603969544dc9c6c43079a5ca59fb3bfef9d81/lib/crf/src/crf1d_tag.c#L490) and returned from `get_tagger()` [here](https://github.com/chokkan/crfsuite/blob/556603969544dc9c6c43079a5ca59fb3bfef9d81/lib/crf/src/crf1d_tag.c#L394).  As such, it is not safe to tag data from multiple threads at once, because the tagging process mutates the tagger.\r\n\r\nIt would be a simple enough change to create a new tagger instance in `get_tagger()` every time.  Would that be enough to ensure thread safety?"},"comment":{"url":"https://api.github.com/repos/chokkan/crfsuite/issues/comments/174409959","html_url":"https://github.com/chokkan/crfsuite/issues/35#issuecomment-174409959","issue_url":"https://api.github.com/repos/chokkan/crfsuite/issues/35","id":174409959,"user":{"login":"chokkan","id":478639,"avatar_url":"https://avatars.githubusercontent.com/u/478639?v=3","gravatar_id":"","url":"https://api.github.com/users/chokkan","html_url":"https://github.com/chokkan","followers_url":"https://api.github.com/users/chokkan/followers","following_url":"https://api.github.com/users/chokkan/following{/other_user}","gists_url":"https://api.github.com/users/chokkan/gists{/gist_id}","starred_url":"https://api.github.com/users/chokkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chokkan/subscriptions","organizations_url":"https://api.github.com/users/chokkan/orgs","repos_url":"https://api.github.com/users/chokkan/repos","events_url":"https://api.github.com/users/chokkan/events{/privacy}","received_events_url":"https://api.github.com/users/chokkan/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T05:38:45Z","updated_at":"2016-01-25T05:38:45Z","body":"Initially, I did not consider the situation where a tagger is used by multiple threads. Your patch does not introduce any extra problem but provides a more reasonable spec. Thanks a lot."}}