{"action":"created","issue":{"url":"https://api.github.com/repos/LLK/scratch-flash/issues/588","labels_url":"https://api.github.com/repos/LLK/scratch-flash/issues/588/labels{/name}","comments_url":"https://api.github.com/repos/LLK/scratch-flash/issues/588/comments","events_url":"https://api.github.com/repos/LLK/scratch-flash/issues/588/events","html_url":"https://github.com/LLK/scratch-flash/issues/588","id":54581812,"number":588,"title":"Strange behavior on evaluation by multiple agents","user":{"login":"cslaviero","id":385329,"avatar_url":"https://avatars.githubusercontent.com/u/385329?v=3","gravatar_id":"","url":"https://api.github.com/users/cslaviero","html_url":"https://github.com/cslaviero","followers_url":"https://api.github.com/users/cslaviero/followers","following_url":"https://api.github.com/users/cslaviero/following{/other_user}","gists_url":"https://api.github.com/users/cslaviero/gists{/gist_id}","starred_url":"https://api.github.com/users/cslaviero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cslaviero/subscriptions","organizations_url":"https://api.github.com/users/cslaviero/orgs","repos_url":"https://api.github.com/users/cslaviero/repos","events_url":"https://api.github.com/users/cslaviero/events{/privacy}","received_events_url":"https://api.github.com/users/cslaviero/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LLK/scratch-flash/labels/Triage","name":"Triage","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"2jour","id":6530036,"avatar_url":"https://avatars.githubusercontent.com/u/6530036?v=3","gravatar_id":"","url":"https://api.github.com/users/2jour","html_url":"https://github.com/2jour","followers_url":"https://api.github.com/users/2jour/followers","following_url":"https://api.github.com/users/2jour/following{/other_user}","gists_url":"https://api.github.com/users/2jour/gists{/gist_id}","starred_url":"https://api.github.com/users/2jour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2jour/subscriptions","organizations_url":"https://api.github.com/users/2jour/orgs","repos_url":"https://api.github.com/users/2jour/repos","events_url":"https://api.github.com/users/2jour/events{/privacy}","received_events_url":"https://api.github.com/users/2jour/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-01-16T14:38:44Z","updated_at":"2015-01-16T15:32:12Z","closed_at":null,"body":"Hello there,\r\n \r\nI'm trying to build a simple version of the Dining Philosophers, which is available at http://scratch.mit.edu/projects/40307764/ . Each of the agents evaluates if there is a fork available in both it's \"left\" and \"right\" sides. If it sees both forks, then the \"philosopher\" takes them by hiding the sprites (using a message that only its left and right forks can listen). \r\n\r\nThe behavior I expected was that only two philosophers would be able to get both forks, since there is not enough forks available to all of them. However, what happens is that all of the philosophers get forks, which in my perspective is not correct. When I run the code manually (by clicking in each philosophers' code to make it run), this behavior happens. \r\n\r\nWhat I'd like to know is whether this behavior is somehow correct, since from what I could read, Scratch has a sequential behavior when running a program. In my programming I could not find any mistake that could be related to this non expected behavior.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/LLK/scratch-flash/issues/comments/70269976","html_url":"https://github.com/LLK/scratch-flash/issues/588#issuecomment-70269976","issue_url":"https://api.github.com/repos/LLK/scratch-flash/issues/588","id":70269976,"user":{"login":"TheLogFather","id":7702458,"avatar_url":"https://avatars.githubusercontent.com/u/7702458?v=3","gravatar_id":"","url":"https://api.github.com/users/TheLogFather","html_url":"https://github.com/TheLogFather","followers_url":"https://api.github.com/users/TheLogFather/followers","following_url":"https://api.github.com/users/TheLogFather/following{/other_user}","gists_url":"https://api.github.com/users/TheLogFather/gists{/gist_id}","starred_url":"https://api.github.com/users/TheLogFather/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheLogFather/subscriptions","organizations_url":"https://api.github.com/users/TheLogFather/orgs","repos_url":"https://api.github.com/users/TheLogFather/repos","events_url":"https://api.github.com/users/TheLogFather/events{/privacy}","received_events_url":"https://api.github.com/users/TheLogFather/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T15:32:12Z","updated_at":"2015-01-16T15:32:12Z","body":"I think I see the problem...\r\n\r\nAre you expecting a broadcast to be received and executed immediately, before any other scripts get a chance to run? That's not the case...\r\n\r\nWhat's happening is that the broadcasts get sent, but the Green Flag scripts all run before the receive scripts get started up.\r\n\r\nIt's only once all GF scripts have finished (and all costume switched) that the receive scripts get a look in.\r\n\r\nDoes that make sense...?\r\n"}}