{"action":"created","issue":{"url":"https://api.github.com/repos/knuppe/SharpNL/issues/26","repository_url":"https://api.github.com/repos/knuppe/SharpNL","labels_url":"https://api.github.com/repos/knuppe/SharpNL/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/knuppe/SharpNL/issues/26/comments","events_url":"https://api.github.com/repos/knuppe/SharpNL/issues/26/events","html_url":"https://github.com/knuppe/SharpNL/issues/26","id":134993667,"number":26,"title":"Multi-threading Support","user":{"login":"harsimranb","id":2235398,"avatar_url":"https://avatars.githubusercontent.com/u/2235398?v=3","gravatar_id":"","url":"https://api.github.com/users/harsimranb","html_url":"https://github.com/harsimranb","followers_url":"https://api.github.com/users/harsimranb/followers","following_url":"https://api.github.com/users/harsimranb/following{/other_user}","gists_url":"https://api.github.com/users/harsimranb/gists{/gist_id}","starred_url":"https://api.github.com/users/harsimranb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harsimranb/subscriptions","organizations_url":"https://api.github.com/users/harsimranb/orgs","repos_url":"https://api.github.com/users/harsimranb/repos","events_url":"https://api.github.com/users/harsimranb/events{/privacy}","received_events_url":"https://api.github.com/users/harsimranb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-19T22:42:50Z","updated_at":"2016-04-27T23:59:08Z","closed_at":"2016-04-27T23:59:08Z","body":"I am trying to classify a bunch of items using Parallel.ForEach.  It seems that SharpNL is not working well with multithreading.  I am getting the following errors:\r\n\r\n```\r\nSystem.NullReferenceException: Object reference not set to an instance of an object.\r\n   at SharpNL.Utility.Cache.Clear() in c:\\GitHub\\SharpNL\\src\\SharpNL\\Utility\\Cache.cs:line 93\r\n   at SharpNL.Utility.FeatureGen.CachedFeatureGenerator.CreateFeatures(List`1 features, String[] tokens, Int32 index, String[] previousOutcomes) in c:\\GitHub\\SharpNL\\src\\SharpNL\\Utility\\FeatureGen\\CachedFeatureGenerator.cs:line 86\r\n   at SharpNL.NameFind.DefaultNameContextGenerator.GetContext(Int32 index, String[] tokens, String[] preds, Object[] additionalContext) in c:\\GitHub\\SharpNL\\src\\SharpNL\\NameFind\\DefaultNameContextGenerator.cs:line 83\r\n   at SharpNL.ML.BeamSearch`1.BestSequences(Int32 numSequences, T[] sequence, Object[] additionalContext, Double minSequenceScore, IBeamSearchContextGenerator`1 beamSearch, ISequenceValidator`1 validator) in c:\\GitHub\\SharpNL\\src\\SharpNL\\ML\\BeamSearch.cs:line 140\r\n   at SharpNL.ML.BeamSearch`1.BestSequences(Int32 numSequences, T[] sequence, Object[] additionalContext, IBeamSearchContextGenerator`1 beamSearch, ISequenceValidator`1 validator) in c:\\GitHub\\SharpNL\\src\\SharpNL\\ML\\BeamSearch.cs:line 108\r\n   at SharpNL.ML.BeamSearch`1.BestSequence(T[] sequence, Object[] additionalContext, IBeamSearchContextGenerator`1 beamSearch, ISequenceValidator`1 validator) in c:\\GitHub\\SharpNL\\src\\SharpNL\\ML\\BeamSearch.cs:line 84\r\n   at SharpNL.NameFind.NameFinderME.Find(String[] tokens, String[][] additionalContext) in c:\\GitHub\\SharpNL\\src\\SharpNL\\NameFind\\NameFinderME.cs:line 221\r\n```\r\n\r\nI will try to look into this more when I get time.  I just wanted to bring this to your attention."},"comment":{"url":"https://api.github.com/repos/knuppe/SharpNL/issues/comments/215268062","html_url":"https://github.com/knuppe/SharpNL/issues/26#issuecomment-215268062","issue_url":"https://api.github.com/repos/knuppe/SharpNL/issues/26","id":215268062,"user":{"login":"knuppe","id":1040818,"avatar_url":"https://avatars.githubusercontent.com/u/1040818?v=3","gravatar_id":"","url":"https://api.github.com/users/knuppe","html_url":"https://github.com/knuppe","followers_url":"https://api.github.com/users/knuppe/followers","following_url":"https://api.github.com/users/knuppe/following{/other_user}","gists_url":"https://api.github.com/users/knuppe/gists{/gist_id}","starred_url":"https://api.github.com/users/knuppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knuppe/subscriptions","organizations_url":"https://api.github.com/users/knuppe/orgs","repos_url":"https://api.github.com/users/knuppe/repos","events_url":"https://api.github.com/users/knuppe/events{/privacy}","received_events_url":"https://api.github.com/users/knuppe/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T23:59:08Z","updated_at":"2016-04-27T23:59:08Z","body":"Take a look at the following test, 100 threads with no problem. :sunglasses: \r\n[NameFinderMultithreadingTest.cs](https://github.com/knuppe/SharpNL/blob/development/src/SharpNL.Tests/NameFind/NameFinderMultithreadingTest.cs#L43)"}}