{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/b564c7e3cc3f2961b2da2d155618f427?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"b564c7e3cc3f2961b2da2d155618f427","url":"https://api.github.com/users/rubychan","login":"rubychan","id":176339},"labels":[{"name":"feature","color":"25bd0d","url":"https://api.github.com/repos/rubinius/rubinius/labels/feature"}],"updated_at":"2011-11-17T22:03:38Z","assignee":null,"closed_at":"2011-11-17T22:03:38Z","comments":3,"url":"https://api.github.com/repos/rubinius/rubinius/issues/1008","body":"[This change request originated in an IRC discussion with dbussink.]\r\n\r\nCurrently, all calls to Oniguruma (Regexp creation and matching) are guarded by onig_lock. This makes it impossible for regexp-using string scanners to use multiple cores. Here's a benchmark that shows how Rubinius 2.0.0pre currently does not run faster when using Regexps on multiple threads: https://gist.github.com/1020620. Note how String#tr, which doesn't use regexps, performs just fine.\r\n\r\nAccording to http://merbist.com/2010/11/12/rubyconf-2010-macruby-talk, Oniguruma is not thread-safe, so the MacRuby team switched to ICU. I can confirm that MacRuby's regexps scale across multiple threads, as do JRuby's (which has its own regexp engine AFAIK). I don't propose to replace Oniguruma, though.\r\n\r\nWhat are the issues that currently prevent us from removing onig_lock? If nobody knows, where would I start to investigate?\r\n\r\nI tried to remove it the quite naïve way (https://gist.github.com/1020720) and got good results with up to 3 threads: https://gist.github.com/1020723. So, maybe it's not so hard to do :-)","html_url":"https://github.com/rubinius/rubinius/issues/1008","number":1008,"title":"Remove onig_lock","id":1043044,"created_at":"2011-06-11T16:29:13Z"},"action":"closed"}