{"action":"created","issue":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/540","labels_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/540/labels{/name}","comments_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/540/comments","events_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/540/events","html_url":"https://github.com/official-stockfish/Stockfish/pull/540","id":123906132,"number":540,"title":"Separate Threads from Position","user":{"login":"lucasart","id":2278294,"avatar_url":"https://avatars.githubusercontent.com/u/2278294?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasart","html_url":"https://github.com/lucasart","followers_url":"https://api.github.com/users/lucasart/followers","following_url":"https://api.github.com/users/lucasart/following{/other_user}","gists_url":"https://api.github.com/users/lucasart/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasart/subscriptions","organizations_url":"https://api.github.com/users/lucasart/orgs","repos_url":"https://api.github.com/users/lucasart/repos","events_url":"https://api.github.com/users/lucasart/events{/privacy}","received_events_url":"https://api.github.com/users/lucasart/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-12-26T03:19:59Z","updated_at":"2015-12-27T12:13:07Z","closed_at":"2015-12-27T08:53:58Z","pull_request":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/pulls/540","html_url":"https://github.com/official-stockfish/Stockfish/pull/540","diff_url":"https://github.com/official-stockfish/Stockfish/pull/540.diff","patch_url":"https://github.com/official-stockfish/Stockfish/pull/540.patch"},"body":"Threads don't belong in Position. This simplifies the Position API, and makes more easily separable from the rest of Stockfish (for those using the Position API it in other programs or experiments).\r\n\r\nThe \"trick\" is to make ThisThread a thread_local variable. That makes it a lot easier to access from anywhere in the code (you don't need a Position object).\r\n\r\nNo functional change.\r\n\r\nOn my configuration (i7-3770k, GCC 5.2.1, Linux 4.2.0), this is actually a small speed-up:\r\n```\r\nstat       test     master    diff\r\nmean  2,600,002  2,589,240  12,490\r\nstdev    15,077     14,466   6,771\r\n\r\nspeedup       0.48%\r\nP(speedup>0) 100.0%\r\n```"},"comment":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/comments/167404822","html_url":"https://github.com/official-stockfish/Stockfish/pull/540#issuecomment-167404822","issue_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/540","id":167404822,"user":{"login":"lucasart","id":2278294,"avatar_url":"https://avatars.githubusercontent.com/u/2278294?v=3","gravatar_id":"","url":"https://api.github.com/users/lucasart","html_url":"https://github.com/lucasart","followers_url":"https://api.github.com/users/lucasart/followers","following_url":"https://api.github.com/users/lucasart/following{/other_user}","gists_url":"https://api.github.com/users/lucasart/gists{/gist_id}","starred_url":"https://api.github.com/users/lucasart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucasart/subscriptions","organizations_url":"https://api.github.com/users/lucasart/orgs","repos_url":"https://api.github.com/users/lucasart/repos","events_url":"https://api.github.com/users/lucasart/events{/privacy}","received_events_url":"https://api.github.com/users/lucasart/received_events","type":"User","site_admin":false},"created_at":"2015-12-27T12:13:07Z","updated_at":"2015-12-27T12:13:07Z","body":"@mstembera: thanks for checking."}}