{"action":"opened","number":836,"pull_request":{"url":"https://api.github.com/repos/erlang/otp/pulls/836","id":45143215,"html_url":"https://github.com/erlang/otp/pull/836","diff_url":"https://github.com/erlang/otp/pull/836.diff","patch_url":"https://github.com/erlang/otp/pull/836.patch","issue_url":"https://api.github.com/repos/erlang/otp/issues/836","number":836,"state":"open","locked":false,"title":"Rework spawn driver","user":{"login":"garazdawi","id":111762,"avatar_url":"https://avatars.githubusercontent.com/u/111762?v=3","gravatar_id":"","url":"https://api.github.com/users/garazdawi","html_url":"https://github.com/garazdawi","followers_url":"https://api.github.com/users/garazdawi/followers","following_url":"https://api.github.com/users/garazdawi/following{/other_user}","gists_url":"https://api.github.com/users/garazdawi/gists{/gist_id}","starred_url":"https://api.github.com/users/garazdawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garazdawi/subscriptions","organizations_url":"https://api.github.com/users/garazdawi/orgs","repos_url":"https://api.github.com/users/garazdawi/repos","events_url":"https://api.github.com/users/garazdawi/events{/privacy}","received_events_url":"https://api.github.com/users/garazdawi/received_events","type":"User","site_admin":false},"body":"Instead of forking from the beam process, we create a separate\r\nprocess in which all forks are done. This has several advantages:\r\n\r\n1) performance:\r\n  * don't have to close all fd's in the world\r\n  * fork only has to copy stuff from a small process\r\n  * work is done in a completely seperate process\r\n  * a 3x performance increase has been measured,\r\n    can be made even greater (10x) if we cache the\r\n    environment in child setup\r\n\r\n2) stability\r\n  * the exec is done in another process than beam, which means that\r\n    if the file that we exec to is on an nfs that is not available\r\n    right now we will not block a scheduler (or the vm in the case of vfork) until the nfs returns.\r\n\r\n3) simplicity\r\n  * don't have to deal with SIGCHLD in the erts\r\n\r\nUnfortunately, this solution also implies some badness.\r\n\r\n1) There will always be a seperate process running together with\r\n   beam on unix. This could be confusing and undesirable.\r\n2) We have to transfer the entire environment to child_setup\r\n   for each command.\r\n\r\nThis pull request also adds two new driver API's that are needed for this feature, erl_drv_set_pid and asynchronous open_port, and various refactorings.","created_at":"2015-09-16T08:22:17Z","updated_at":"2015-09-16T08:22:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/erlang/otp/pulls/836/commits","review_comments_url":"https://api.github.com/repos/erlang/otp/pulls/836/comments","review_comment_url":"https://api.github.com/repos/erlang/otp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/erlang/otp/issues/836/comments","statuses_url":"https://api.github.com/repos/erlang/otp/statuses/489897edd3fcf84e410ebbc30e4d10f1aa73d433","head":{"label":"garazdawi:lukas/erts/forker","ref":"lukas/erts/forker","sha":"489897edd3fcf84e410ebbc30e4d10f1aa73d433","user":{"login":"garazdawi","id":111762,"avatar_url":"https://avatars.githubusercontent.com/u/111762?v=3","gravatar_id":"","url":"https://api.github.com/users/garazdawi","html_url":"https://github.com/garazdawi","followers_url":"https://api.github.com/users/garazdawi/followers","following_url":"https://api.github.com/users/garazdawi/following{/other_user}","gists_url":"https://api.github.com/users/garazdawi/gists{/gist_id}","starred_url":"https://api.github.com/users/garazdawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garazdawi/subscriptions","organizations_url":"https://api.github.com/users/garazdawi/orgs","repos_url":"https://api.github.com/users/garazdawi/repos","events_url":"https://api.github.com/users/garazdawi/events{/privacy}","received_events_url":"https://api.github.com/users/garazdawi/received_events","type":"User","site_admin":false},"repo":{"id":843890,"name":"otp","full_name":"garazdawi/otp","owner":{"login":"garazdawi","id":111762,"avatar_url":"https://avatars.githubusercontent.com/u/111762?v=3","gravatar_id":"","url":"https://api.github.com/users/garazdawi","html_url":"https://github.com/garazdawi","followers_url":"https://api.github.com/users/garazdawi/followers","following_url":"https://api.github.com/users/garazdawi/following{/other_user}","gists_url":"https://api.github.com/users/garazdawi/gists{/gist_id}","starred_url":"https://api.github.com/users/garazdawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garazdawi/subscriptions","organizations_url":"https://api.github.com/users/garazdawi/orgs","repos_url":"https://api.github.com/users/garazdawi/repos","events_url":"https://api.github.com/users/garazdawi/events{/privacy}","received_events_url":"https://api.github.com/users/garazdawi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garazdawi/otp","description":"Erlang/OTP","fork":true,"url":"https://api.github.com/repos/garazdawi/otp","forks_url":"https://api.github.com/repos/garazdawi/otp/forks","keys_url":"https://api.github.com/repos/garazdawi/otp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garazdawi/otp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garazdawi/otp/teams","hooks_url":"https://api.github.com/repos/garazdawi/otp/hooks","issue_events_url":"https://api.github.com/repos/garazdawi/otp/issues/events{/number}","events_url":"https://api.github.com/repos/garazdawi/otp/events","assignees_url":"https://api.github.com/repos/garazdawi/otp/assignees{/user}","branches_url":"https://api.github.com/repos/garazdawi/otp/branches{/branch}","tags_url":"https://api.github.com/repos/garazdawi/otp/tags","blobs_url":"https://api.github.com/repos/garazdawi/otp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garazdawi/otp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garazdawi/otp/git/refs{/sha}","trees_url":"https://api.github.com/repos/garazdawi/otp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garazdawi/otp/statuses/{sha}","languages_url":"https://api.github.com/repos/garazdawi/otp/languages","stargazers_url":"https://api.github.com/repos/garazdawi/otp/stargazers","contributors_url":"https://api.github.com/repos/garazdawi/otp/contributors","subscribers_url":"https://api.github.com/repos/garazdawi/otp/subscribers","subscription_url":"https://api.github.com/repos/garazdawi/otp/subscription","commits_url":"https://api.github.com/repos/garazdawi/otp/commits{/sha}","git_commits_url":"https://api.github.com/repos/garazdawi/otp/git/commits{/sha}","comments_url":"https://api.github.com/repos/garazdawi/otp/comments{/number}","issue_comment_url":"https://api.github.com/repos/garazdawi/otp/issues/comments{/number}","contents_url":"https://api.github.com/repos/garazdawi/otp/contents/{+path}","compare_url":"https://api.github.com/repos/garazdawi/otp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garazdawi/otp/merges","archive_url":"https://api.github.com/repos/garazdawi/otp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garazdawi/otp/downloads","issues_url":"https://api.github.com/repos/garazdawi/otp/issues{/number}","pulls_url":"https://api.github.com/repos/garazdawi/otp/pulls{/number}","milestones_url":"https://api.github.com/repos/garazdawi/otp/milestones{/number}","notifications_url":"https://api.github.com/repos/garazdawi/otp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garazdawi/otp/labels{/name}","releases_url":"https://api.github.com/repos/garazdawi/otp/releases{/id}","created_at":"2010-08-17T15:09:26Z","updated_at":"2015-03-20T16:54:09Z","pushed_at":"2015-09-15T14:30:50Z","git_url":"git://github.com/garazdawi/otp.git","ssh_url":"git@github.com:garazdawi/otp.git","clone_url":"https://github.com/garazdawi/otp.git","svn_url":"https://github.com/garazdawi/otp","homepage":"http://erlang.org","size":173766,"stargazers_count":3,"watchers_count":3,"language":"Erlang","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"erlang:master","ref":"master","sha":"ddd1acec5100f5bcc96b29f09b80edd717746edf","user":{"login":"erlang","id":153393,"avatar_url":"https://avatars.githubusercontent.com/u/153393?v=3","gravatar_id":"","url":"https://api.github.com/users/erlang","html_url":"https://github.com/erlang","followers_url":"https://api.github.com/users/erlang/followers","following_url":"https://api.github.com/users/erlang/following{/other_user}","gists_url":"https://api.github.com/users/erlang/gists{/gist_id}","starred_url":"https://api.github.com/users/erlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erlang/subscriptions","organizations_url":"https://api.github.com/users/erlang/orgs","repos_url":"https://api.github.com/users/erlang/repos","events_url":"https://api.github.com/users/erlang/events{/privacy}","received_events_url":"https://api.github.com/users/erlang/received_events","type":"Organization","site_admin":false},"repo":{"id":374927,"name":"otp","full_name":"erlang/otp","owner":{"login":"erlang","id":153393,"avatar_url":"https://avatars.githubusercontent.com/u/153393?v=3","gravatar_id":"","url":"https://api.github.com/users/erlang","html_url":"https://github.com/erlang","followers_url":"https://api.github.com/users/erlang/followers","following_url":"https://api.github.com/users/erlang/following{/other_user}","gists_url":"https://api.github.com/users/erlang/gists{/gist_id}","starred_url":"https://api.github.com/users/erlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erlang/subscriptions","organizations_url":"https://api.github.com/users/erlang/orgs","repos_url":"https://api.github.com/users/erlang/repos","events_url":"https://api.github.com/users/erlang/events{/privacy}","received_events_url":"https://api.github.com/users/erlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erlang/otp","description":"Erlang/OTP","fork":false,"url":"https://api.github.com/repos/erlang/otp","forks_url":"https://api.github.com/repos/erlang/otp/forks","keys_url":"https://api.github.com/repos/erlang/otp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erlang/otp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erlang/otp/teams","hooks_url":"https://api.github.com/repos/erlang/otp/hooks","issue_events_url":"https://api.github.com/repos/erlang/otp/issues/events{/number}","events_url":"https://api.github.com/repos/erlang/otp/events","assignees_url":"https://api.github.com/repos/erlang/otp/assignees{/user}","branches_url":"https://api.github.com/repos/erlang/otp/branches{/branch}","tags_url":"https://api.github.com/repos/erlang/otp/tags","blobs_url":"https://api.github.com/repos/erlang/otp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erlang/otp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erlang/otp/git/refs{/sha}","trees_url":"https://api.github.com/repos/erlang/otp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erlang/otp/statuses/{sha}","languages_url":"https://api.github.com/repos/erlang/otp/languages","stargazers_url":"https://api.github.com/repos/erlang/otp/stargazers","contributors_url":"https://api.github.com/repos/erlang/otp/contributors","subscribers_url":"https://api.github.com/repos/erlang/otp/subscribers","subscription_url":"https://api.github.com/repos/erlang/otp/subscription","commits_url":"https://api.github.com/repos/erlang/otp/commits{/sha}","git_commits_url":"https://api.github.com/repos/erlang/otp/git/commits{/sha}","comments_url":"https://api.github.com/repos/erlang/otp/comments{/number}","issue_comment_url":"https://api.github.com/repos/erlang/otp/issues/comments{/number}","contents_url":"https://api.github.com/repos/erlang/otp/contents/{+path}","compare_url":"https://api.github.com/repos/erlang/otp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erlang/otp/merges","archive_url":"https://api.github.com/repos/erlang/otp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erlang/otp/downloads","issues_url":"https://api.github.com/repos/erlang/otp/issues{/number}","pulls_url":"https://api.github.com/repos/erlang/otp/pulls{/number}","milestones_url":"https://api.github.com/repos/erlang/otp/milestones{/number}","notifications_url":"https://api.github.com/repos/erlang/otp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erlang/otp/labels{/name}","releases_url":"https://api.github.com/repos/erlang/otp/releases{/id}","created_at":"2009-11-16T17:17:57Z","updated_at":"2015-09-16T05:48:42Z","pushed_at":"2015-09-15T15:36:19Z","git_url":"git://github.com/erlang/otp.git","ssh_url":"git@github.com:erlang/otp.git","clone_url":"https://github.com/erlang/otp.git","svn_url":"https://github.com/erlang/otp","homepage":"http://erlang.org","size":231130,"stargazers_count":3692,"watchers_count":3692,"language":"Erlang","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":1137,"mirror_url":null,"open_issues_count":92,"forks":1137,"open_issues":92,"watchers":3692,"default_branch":"maint"}},"_links":{"self":{"href":"https://api.github.com/repos/erlang/otp/pulls/836"},"html":{"href":"https://github.com/erlang/otp/pull/836"},"issue":{"href":"https://api.github.com/repos/erlang/otp/issues/836"},"comments":{"href":"https://api.github.com/repos/erlang/otp/issues/836/comments"},"review_comments":{"href":"https://api.github.com/repos/erlang/otp/pulls/836/comments"},"review_comment":{"href":"https://api.github.com/repos/erlang/otp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/erlang/otp/pulls/836/commits"},"statuses":{"href":"https://api.github.com/repos/erlang/otp/statuses/489897edd3fcf84e410ebbc30e4d10f1aa73d433"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":18,"additions":3082,"deletions":2433,"changed_files":43}}