{"action":"opened","issue":{"url":"https://api.github.com/repos/zostay/P6SGI/issues/35","labels_url":"https://api.github.com/repos/zostay/P6SGI/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/zostay/P6SGI/issues/35/comments","events_url":"https://api.github.com/repos/zostay/P6SGI/issues/35/events","html_url":"https://github.com/zostay/P6SGI/issues/35","id":111981335,"number":35,"title":"Study the consequences of concurrency and parallelism here","user":{"login":"zostay","id":34711,"avatar_url":"https://avatars.githubusercontent.com/u/34711?v=3","gravatar_id":"","url":"https://api.github.com/users/zostay","html_url":"https://github.com/zostay","followers_url":"https://api.github.com/users/zostay/followers","following_url":"https://api.github.com/users/zostay/following{/other_user}","gists_url":"https://api.github.com/users/zostay/gists{/gist_id}","starred_url":"https://api.github.com/users/zostay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zostay/subscriptions","organizations_url":"https://api.github.com/users/zostay/orgs","repos_url":"https://api.github.com/users/zostay/repos","events_url":"https://api.github.com/users/zostay/events{/privacy}","received_events_url":"https://api.github.com/users/zostay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-17T19:41:24Z","updated_at":"2015-10-17T19:41:24Z","closed_at":null,"body":"One issue I've had in the back of my mind is the probably of running concurrently with a limited number of threads. It is possible and even likely that someone will want to run an app server on a very small number of threads. These limits might even be imposed per connection or some such in a carefully optimized environment. As such, running start {} for a long running has some risk associated with it that doesn't necessarily exist in a purely synchronous environment.\r\n\r\nThe built-in scheduler for Perl 6 is very clever so that if you Promise to start 30 blocks of code on a process that is limited to 16 threads (the default in my experience), all 30 blocks of code will run so long as they are not too dependent on one another. If completely independent, the scheduler will run the next one in the wait list as soon as one of the running threads is freed up.\r\n\r\nThe way this is currently designed, I don't think we have a problem. However, once we have a reference implementation working, I think it would be a good idea to consider how different arrangements of middleware, different server implementations, and different applications may impact the available threads and performance so we can seek out optimizations and/or add best practices documentation that describes the best ways to write servers, middleware, and apps to maximize performance and minimize the risk of running out of threads and such."}}