{"action":"opened","issue":{"url":"https://api.github.com/repos/ManticoreProject/manticore/issues/1","repository_url":"https://api.github.com/repos/ManticoreProject/manticore","labels_url":"https://api.github.com/repos/ManticoreProject/manticore/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ManticoreProject/manticore/issues/1/comments","events_url":"https://api.github.com/repos/ManticoreProject/manticore/issues/1/events","html_url":"https://github.com/ManticoreProject/manticore/issues/1","id":133347724,"number":1,"title":"VProc Deadlock","user":{"login":"ml9951","id":13142923,"avatar_url":"https://avatars.githubusercontent.com/u/13142923?v=3","gravatar_id":"","url":"https://api.github.com/users/ml9951","html_url":"https://github.com/ml9951","followers_url":"https://api.github.com/users/ml9951/followers","following_url":"https://api.github.com/users/ml9951/following{/other_user}","gists_url":"https://api.github.com/users/ml9951/gists{/gist_id}","starred_url":"https://api.github.com/users/ml9951/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ml9951/subscriptions","organizations_url":"https://api.github.com/users/ml9951/orgs","repos_url":"https://api.github.com/users/ml9951/repos","events_url":"https://api.github.com/users/ml9951/events{/privacy}","received_events_url":"https://api.github.com/users/ml9951/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-12T21:30:12Z","updated_at":"2016-02-12T21:30:12Z","closed_at":null,"body":"The work stealing scheduler can still deadlock despite the previously proposed \"fix\" of playing with the number of idle VProcs.  \r\n\r\nCurrently, we set `nIdle` in the workgroup to `-1` so the work group cannot shutdown before the first task is put on the deque.  Once the first deque is placed on the deque, we atomically increment `nIdle`.  \r\n\r\nThe problem occurs in the following sequence of events\r\n\r\n1. The work stealing instance on the main VProc goes to sleep\r\n2. Place the main task on the main VProc's deque\r\n3. Atomically increment `nIdle`\r\n4. Remaining threads go to sleep\r\n5. Work group shuts down without running the first task.\r\n\r\n\r\n"}}