{"action":"opened","issue":{"url":"https://api.github.com/repos/rayon-rs/rayon/issues/547","repository_url":"https://api.github.com/repos/rayon-rs/rayon","labels_url":"https://api.github.com/repos/rayon-rs/rayon/issues/547/labels{/name}","comments_url":"https://api.github.com/repos/rayon-rs/rayon/issues/547/comments","events_url":"https://api.github.com/repos/rayon-rs/rayon/issues/547/events","html_url":"https://github.com/rayon-rs/rayon/issues/547","id":301230219,"number":547,"title":"pre-RFC: spawn \"external\" scoped threads","user":{"login":"cuviper","id":36186,"avatar_url":"https://avatars1.githubusercontent.com/u/36186?v=4","gravatar_id":"","url":"https://api.github.com/users/cuviper","html_url":"https://github.com/cuviper","followers_url":"https://api.github.com/users/cuviper/followers","following_url":"https://api.github.com/users/cuviper/following{/other_user}","gists_url":"https://api.github.com/users/cuviper/gists{/gist_id}","starred_url":"https://api.github.com/users/cuviper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cuviper/subscriptions","organizations_url":"https://api.github.com/users/cuviper/orgs","repos_url":"https://api.github.com/users/cuviper/repos","events_url":"https://api.github.com/users/cuviper/events{/privacy}","received_events_url":"https://api.github.com/users/cuviper/received_events","type":"User","site_admin":false},"labels":[{"id":134340014,"url":"https://api.github.com/repos/rayon-rs/rayon/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-01T00:00:13Z","updated_at":"2018-03-01T00:00:13Z","closed_at":null,"author_association":"OWNER","body":"In https://github.com/QuietMisdreavus/polyester/pull/6#issuecomment-369419550 I suggested creating a private single-thread pool for reading their iterator, while the current pool could continue processing work.  This is awkward though, and one downside is that any rayon work in that call would also be bound to that single-thread pool.\r\n\r\nBut I think this general idea could be useful for any kind of external blocking.  I'm imagining a `rayon::spawn_external(|| ...)` which starts a new thread, runs a scoped closure, and waits for it to return.  Importantly, that waiting should be cooperative with Rayon, where the caller will go steal other work while it waits.  If the caller is not in a pool already, maybe just run the closure directly.\r\n\r\nThe new thread will not be in a thread pool (i.e. not a `WorkerThread`), so if it makes any rayon calls itself, those will go to the global thread pool."}}
{"actor":{"display_login":"cuviper"}}