{"action":"created","comment":{"url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments/39770048","id":39770048,"diff_hunk":"@@ -1 +1,47 @@\n # Your answers here\n+\n+\n+1)\n+A typical result I get when I run P6A.py is:\n+Hi Job 0\n+Hi Job 2\n+Hi Job 3\n+Hi Job 1\n+Bye Job 0\n+Hi Job 4\n+Bye Job 3\n+Hi Job 5\n+Bye Job 2\n+Bye Job 1\n+Hi Job 6\n+Hi Job 7\n+Bye Job 4\n+Hi Job 8\n+Bye Job 5\n+Hi Job 9\n+Bye Job 7\n+Bye Job 6\n+Bye Job 8\n+Bye Job 9\n+\n+We see that Jobs are not finished in the same order as they are started.\n+We also see that jobs are not started in the right order.\n+A possible explanation is that there are sometimes some lock in the\n+communication.\n+The fact that jobs don't start in the right order can be a problem if a\n+job needs some information depending on a previous job.\n+An example is for example is we apply the function x->(x+j)**2 to the input\n+with j the number of the jobs. This being non linear, will not give the right\n+answer if jobs are not computed in the right order.\n+I found an interesting quote from \"how to survive the multicore revolution\"\n+that explains the type of issue raised by multiprocessors named \"race\n+condition\".\n+\"A race condition occurs when concurrent software tasks access a shared-memory\n+location and at least one of the tasks stores a value into the location.\n+Depending on the scheduling of the tasks, the software may behave differently.\"\n+This better explains the point that I wanted to make.","path":"HW0/P6/P6.txt","position":42,"original_position":42,"commit_id":"69439ff4e705824bb152c2d330ab9c3a9e5ec6d3","original_commit_id":"69439ff4e705824bb152c2d330ab9c3a9e5ec6d3","user":{"login":"rpestourie","id":5632523,"avatar_url":"https://avatars.githubusercontent.com/u/5632523?v=3","gravatar_id":"","url":"https://api.github.com/users/rpestourie","html_url":"https://github.com/rpestourie","followers_url":"https://api.github.com/users/rpestourie/followers","following_url":"https://api.github.com/users/rpestourie/following{/other_user}","gists_url":"https://api.github.com/users/rpestourie/gists{/gist_id}","starred_url":"https://api.github.com/users/rpestourie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpestourie/subscriptions","organizations_url":"https://api.github.com/users/rpestourie/orgs","repos_url":"https://api.github.com/users/rpestourie/repos","events_url":"https://api.github.com/users/rpestourie/events{/privacy}","received_events_url":"https://api.github.com/users/rpestourie/received_events","type":"User","site_admin":false},"body":"Good question! It's hard to say because I don't really know precisely how this implementation of multiprocessor works. Maybe using an iterator would make help but it would also add some communication cost and it would kind of serialize a part of the program. I hope to learn more about it later in the class.","created_at":"2015-09-17T16:56:31Z","updated_at":"2015-09-17T16:56:31Z","html_url":"https://github.com/harvard-cs205/cs205-homework/pull/187#discussion_r39770048","pull_request_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187","_links":{"self":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments/39770048"},"html":{"href":"https://github.com/harvard-cs205/cs205-homework/pull/187#discussion_r39770048"},"pull_request":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187"}}},"pull_request":{"url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187","id":45225115,"html_url":"https://github.com/harvard-cs205/cs205-homework/pull/187","diff_url":"https://github.com/harvard-cs205/cs205-homework/pull/187.diff","patch_url":"https://github.com/harvard-cs205/cs205-homework/pull/187.patch","issue_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/187","number":187,"state":"open","locked":false,"title":"Hw0b","user":{"login":"rpestourie","id":5632523,"avatar_url":"https://avatars.githubusercontent.com/u/5632523?v=3","gravatar_id":"","url":"https://api.github.com/users/rpestourie","html_url":"https://github.com/rpestourie","followers_url":"https://api.github.com/users/rpestourie/followers","following_url":"https://api.github.com/users/rpestourie/following{/other_user}","gists_url":"https://api.github.com/users/rpestourie/gists{/gist_id}","starred_url":"https://api.github.com/users/rpestourie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpestourie/subscriptions","organizations_url":"https://api.github.com/users/rpestourie/orgs","repos_url":"https://api.github.com/users/rpestourie/repos","events_url":"https://api.github.com/users/rpestourie/events{/privacy}","received_events_url":"https://api.github.com/users/rpestourie/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-16T21:13:47Z","updated_at":"2015-09-17T16:56:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36cb61389efe1e50f3eb3ae93644cbeb116dfcc2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187/commits","review_comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187/comments","review_comment_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/187/comments","statuses_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/69439ff4e705824bb152c2d330ab9c3a9e5ec6d3","head":{"label":"rpestourie:HW0b","ref":"HW0b","sha":"69439ff4e705824bb152c2d330ab9c3a9e5ec6d3","user":{"login":"rpestourie","id":5632523,"avatar_url":"https://avatars.githubusercontent.com/u/5632523?v=3","gravatar_id":"","url":"https://api.github.com/users/rpestourie","html_url":"https://github.com/rpestourie","followers_url":"https://api.github.com/users/rpestourie/followers","following_url":"https://api.github.com/users/rpestourie/following{/other_user}","gists_url":"https://api.github.com/users/rpestourie/gists{/gist_id}","starred_url":"https://api.github.com/users/rpestourie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpestourie/subscriptions","organizations_url":"https://api.github.com/users/rpestourie/orgs","repos_url":"https://api.github.com/users/rpestourie/repos","events_url":"https://api.github.com/users/rpestourie/events{/privacy}","received_events_url":"https://api.github.com/users/rpestourie/received_events","type":"User","site_admin":false},"repo":{"id":41938747,"name":"cs205-homework","full_name":"rpestourie/cs205-homework","owner":{"login":"rpestourie","id":5632523,"avatar_url":"https://avatars.githubusercontent.com/u/5632523?v=3","gravatar_id":"","url":"https://api.github.com/users/rpestourie","html_url":"https://github.com/rpestourie","followers_url":"https://api.github.com/users/rpestourie/followers","following_url":"https://api.github.com/users/rpestourie/following{/other_user}","gists_url":"https://api.github.com/users/rpestourie/gists{/gist_id}","starred_url":"https://api.github.com/users/rpestourie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpestourie/subscriptions","organizations_url":"https://api.github.com/users/rpestourie/orgs","repos_url":"https://api.github.com/users/rpestourie/repos","events_url":"https://api.github.com/users/rpestourie/events{/privacy}","received_events_url":"https://api.github.com/users/rpestourie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rpestourie/cs205-homework","description":"","fork":true,"url":"https://api.github.com/repos/rpestourie/cs205-homework","forks_url":"https://api.github.com/repos/rpestourie/cs205-homework/forks","keys_url":"https://api.github.com/repos/rpestourie/cs205-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rpestourie/cs205-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rpestourie/cs205-homework/teams","hooks_url":"https://api.github.com/repos/rpestourie/cs205-homework/hooks","issue_events_url":"https://api.github.com/repos/rpestourie/cs205-homework/issues/events{/number}","events_url":"https://api.github.com/repos/rpestourie/cs205-homework/events","assignees_url":"https://api.github.com/repos/rpestourie/cs205-homework/assignees{/user}","branches_url":"https://api.github.com/repos/rpestourie/cs205-homework/branches{/branch}","tags_url":"https://api.github.com/repos/rpestourie/cs205-homework/tags","blobs_url":"https://api.github.com/repos/rpestourie/cs205-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rpestourie/cs205-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rpestourie/cs205-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rpestourie/cs205-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rpestourie/cs205-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/rpestourie/cs205-homework/languages","stargazers_url":"https://api.github.com/repos/rpestourie/cs205-homework/stargazers","contributors_url":"https://api.github.com/repos/rpestourie/cs205-homework/contributors","subscribers_url":"https://api.github.com/repos/rpestourie/cs205-homework/subscribers","subscription_url":"https://api.github.com/repos/rpestourie/cs205-homework/subscription","commits_url":"https://api.github.com/repos/rpestourie/cs205-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rpestourie/cs205-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rpestourie/cs205-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rpestourie/cs205-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rpestourie/cs205-homework/contents/{+path}","compare_url":"https://api.github.com/repos/rpestourie/cs205-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rpestourie/cs205-homework/merges","archive_url":"https://api.github.com/repos/rpestourie/cs205-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rpestourie/cs205-homework/downloads","issues_url":"https://api.github.com/repos/rpestourie/cs205-homework/issues{/number}","pulls_url":"https://api.github.com/repos/rpestourie/cs205-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/rpestourie/cs205-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/rpestourie/cs205-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rpestourie/cs205-homework/labels{/name}","releases_url":"https://api.github.com/repos/rpestourie/cs205-homework/releases{/id}","created_at":"2015-09-04T21:33:46Z","updated_at":"2015-09-16T20:13:05Z","pushed_at":"2015-09-11T22:28:28Z","git_url":"git://github.com/rpestourie/cs205-homework.git","ssh_url":"git@github.com:rpestourie/cs205-homework.git","clone_url":"https://github.com/rpestourie/cs205-homework.git","svn_url":"https://github.com/rpestourie/cs205-homework","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"harvard-cs205:master","ref":"master","sha":"406f864b38a6c8a3d89cba66cb5228e98907bab7","user":{"login":"harvard-cs205","id":13456002,"avatar_url":"https://avatars.githubusercontent.com/u/13456002?v=3","gravatar_id":"","url":"https://api.github.com/users/harvard-cs205","html_url":"https://github.com/harvard-cs205","followers_url":"https://api.github.com/users/harvard-cs205/followers","following_url":"https://api.github.com/users/harvard-cs205/following{/other_user}","gists_url":"https://api.github.com/users/harvard-cs205/gists{/gist_id}","starred_url":"https://api.github.com/users/harvard-cs205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harvard-cs205/subscriptions","organizations_url":"https://api.github.com/users/harvard-cs205/orgs","repos_url":"https://api.github.com/users/harvard-cs205/repos","events_url":"https://api.github.com/users/harvard-cs205/events{/privacy}","received_events_url":"https://api.github.com/users/harvard-cs205/received_events","type":"Organization","site_admin":false},"repo":{"id":40614104,"name":"cs205-homework","full_name":"harvard-cs205/cs205-homework","owner":{"login":"harvard-cs205","id":13456002,"avatar_url":"https://avatars.githubusercontent.com/u/13456002?v=3","gravatar_id":"","url":"https://api.github.com/users/harvard-cs205","html_url":"https://github.com/harvard-cs205","followers_url":"https://api.github.com/users/harvard-cs205/followers","following_url":"https://api.github.com/users/harvard-cs205/following{/other_user}","gists_url":"https://api.github.com/users/harvard-cs205/gists{/gist_id}","starred_url":"https://api.github.com/users/harvard-cs205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harvard-cs205/subscriptions","organizations_url":"https://api.github.com/users/harvard-cs205/orgs","repos_url":"https://api.github.com/users/harvard-cs205/repos","events_url":"https://api.github.com/users/harvard-cs205/events{/privacy}","received_events_url":"https://api.github.com/users/harvard-cs205/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/harvard-cs205/cs205-homework","description":"","fork":false,"url":"https://api.github.com/repos/harvard-cs205/cs205-homework","forks_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/forks","keys_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/teams","hooks_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/hooks","issue_events_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/events{/number}","events_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/events","assignees_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/assignees{/user}","branches_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/branches{/branch}","tags_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/tags","blobs_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/languages","stargazers_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/stargazers","contributors_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/contributors","subscribers_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/subscribers","subscription_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/subscription","commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/contents/{+path}","compare_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/merges","archive_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/downloads","issues_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues{/number}","pulls_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/labels{/name}","releases_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/releases{/id}","created_at":"2015-08-12T17:18:15Z","updated_at":"2015-09-17T01:30:31Z","pushed_at":"2015-09-16T21:13:48Z","git_url":"git://github.com/harvard-cs205/cs205-homework.git","ssh_url":"git@github.com:harvard-cs205/cs205-homework.git","clone_url":"https://github.com/harvard-cs205/cs205-homework.git","svn_url":"https://github.com/harvard-cs205/cs205-homework","homepage":null,"size":16490,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":182,"forks":98,"open_issues":182,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187"},"html":{"href":"https://github.com/harvard-cs205/cs205-homework/pull/187"},"issue":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/187"},"comments":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187/comments"},"review_comment":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/187/commits"},"statuses":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/69439ff4e705824bb152c2d330ab9c3a9e5ec6d3"}}}}