{"action":"created","issue":{"url":"https://api.github.com/repos/scalaz/scalaz-stream/issues/301","labels_url":"https://api.github.com/repos/scalaz/scalaz-stream/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/scalaz/scalaz-stream/issues/301/comments","events_url":"https://api.github.com/repos/scalaz/scalaz-stream/issues/301/events","html_url":"https://github.com/scalaz/scalaz-stream/issues/301","id":53794937,"number":301,"title":"async.signalOf generates deadlocks","user":{"login":"djspiewak","id":752,"avatar_url":"https://avatars.githubusercontent.com/u/752?v=3","gravatar_id":"","url":"https://api.github.com/users/djspiewak","html_url":"https://github.com/djspiewak","followers_url":"https://api.github.com/users/djspiewak/followers","following_url":"https://api.github.com/users/djspiewak/following{/other_user}","gists_url":"https://api.github.com/users/djspiewak/gists{/gist_id}","starred_url":"https://api.github.com/users/djspiewak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djspiewak/subscriptions","organizations_url":"https://api.github.com/users/djspiewak/orgs","repos_url":"https://api.github.com/users/djspiewak/repos","events_url":"https://api.github.com/users/djspiewak/events{/privacy}","received_events_url":"https://api.github.com/users/djspiewak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-08T20:09:19Z","updated_at":"2015-01-08T21:14:12Z","closed_at":null,"body":"```scala\r\nval problemo = Task {\r\n  async.signalOf(())\r\n}\r\n```\r\n\r\nRun a crudton of `problemo` instances concurrently, ideally with a smallish thread pool in your `Strategy` (we tested with 2 threads).  You will very quickly run into a deadlock stemming from thread starvation.\r\n\r\nThe problem is that `signalOf` delegates to `run` internally, which doesn't appear to reschedule the current thread appropriately.  Ultimately, you just run out of threads to use in the `Strategy` thread pool, and `Task#run` starts blocking indefinitely.\r\n\r\nThe workaround here is to just not use `signalOf`:\r\n\r\n```scala\r\nval problemo = {\r\n  val s = async.signal[Unit]\r\n  s set (()) >> (Task now s)\r\n}"},"comment":{"url":"https://api.github.com/repos/scalaz/scalaz-stream/issues/comments/69250281","html_url":"https://github.com/scalaz/scalaz-stream/issues/301#issuecomment-69250281","issue_url":"https://api.github.com/repos/scalaz/scalaz-stream/issues/301","id":69250281,"user":{"login":"pchiusano","id":11074,"avatar_url":"https://avatars.githubusercontent.com/u/11074?v=3","gravatar_id":"","url":"https://api.github.com/users/pchiusano","html_url":"https://github.com/pchiusano","followers_url":"https://api.github.com/users/pchiusano/followers","following_url":"https://api.github.com/users/pchiusano/following{/other_user}","gists_url":"https://api.github.com/users/pchiusano/gists{/gist_id}","starred_url":"https://api.github.com/users/pchiusano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchiusano/subscriptions","organizations_url":"https://api.github.com/users/pchiusano/orgs","repos_url":"https://api.github.com/users/pchiusano/repos","events_url":"https://api.github.com/users/pchiusano/events{/privacy}","received_events_url":"https://api.github.com/users/pchiusano/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T21:14:12Z","updated_at":"2015-01-08T21:14:12Z","body":"Deprecating works for me."}}