<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with synchronization - Gideros Forums</title>
      <link>http://giderosmobile.com/forum/discussions/tagged/synchronization/feed.rss</link>
      <pubDate>Thu, 23 May 13 01:45:05 -0400</pubDate>
         <description>Tagged with synchronization - Gideros Forums</description>
   <language>en-CA</language>
   <atom:link href="/forum/discussions/taggedsynchronization/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Semaphores, synchronization, locked during callback functions</title>
      <link>http://giderosmobile.com/forum/discussion/971/semaphores-synchronization-locked-during-callback-functions</link>
      <pubDate>Wed, 09 May 2012 20:32:32 -0400</pubDate>
      <dc:creator>kussakov</dc:creator>
      <guid isPermaLink="false">971@/forum/discussions</guid>
      <description><![CDATA[Hi,<br /><br />I have a few questions:<br /><br />1. Is there a way to synchronize things (like semaphores) in Gideros?<br />E.g. Some way for the code to wait like a millisecond until some callback function is completed.<br />Like synchronized(something){... some code ...} in objective C...<br /><br />2. Many physics APIs are locked during callbacks.<br />What does that mean?<br />Are they locked while the physics world is doing a "step()"?<br />Or are they just locked INSIDE a physics callback (like on event Event.POST_SOLVE callback)?<br />Say I have a game and I want to destroy or add bodies due to some user actions. <br />Create and destroy body are locked during callbacks...<br />The user actions a completely outside the physics callbacks. Is this safe?<br />I am asking because I was doing a test - when the user touches the screen I would add many sprites to the scene + corresponding bodies to the physical world.<br />Very occasionally there is a sprite that does not move as if the engine could not create and associate a body for it. There are no errors.<br /><br />3. If you answer to question 2 is "locked during a step()" - then I need some kind of semaphores to synchronize the physics world locked stuff with the users actions and make sure they don't happen while the wold is doing a step (which is happening on Event.ENTER_FRAME by the way).<br /><br />Since the entire thing works only in callbacks (touches, physics, enter frame, etc.) it will be very hard to work with locked functions without semaphores.<br />And I can't use global variables for that because the code has to wait...<br /><br />Thanks<br /><br />Vlad<br />]]></description>
   </item>
   </channel>
</rss>