Andrei, that's probably the right implementation, considering that an application can run in multiple JVMs.
Where this sort of thing becomes very tricky is when people start using the JVM's local memory as an even faster cache than Memcache and don't synchronize access to data structures, which leads consistency issues. Most people who aren't doing this or twiddling with local memory shouldn't have to worry about this. Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine On Thu, Mar 31, 2011 at 10:06 AM, Andrei Cosmin Fifiiţă < [email protected]> wrote: > Well, i my servlet methods (i use GWT RPC) do not use Thread specific > operations and they don't access any shared objects other than > Memcache objects, Session, or Datastore entities. > > On 31 March 2011 18:20, Remigius <[email protected]> wrote: > > Ice13ill, > > > > There's a short and a long long answer to your question. > > > > The short one: If you don't already know what "proper thread > > synchronization" is, leave the <threadsafe> option switched off. > > > > The long one: Switching it on allows multiple HTTP requests to be > > handled concurrently by the same instance of your Java servlet. This > > means that all data structures that are accessible through instance > > members or static members can be accessed simultaneously by more than > > one running thread, which may result in unexpected errors if a thread > > manipulates a structure in a way that leaves it temporarily in an > > inconsistent state. Such errors are hard to trace as they may occur > > infrequently and be impossible to reproduce in a deterministic way. > > There are ways to ensure that such manipulations can not be > > interrupted, which is known as synchronization. There is a lot of > > information around (on the net and in printed form) on threadsafe > > programming in general and synchronization in particular. > > > > Cheers, Remigius. > > > > On 31 Mrz., 13:51, Ice13ill <[email protected]> wrote: > >> What dies thread safe really mean ? ("your application code needs to > >> use proper thread synchronization before you enable <threadsafe>"). > >> Can someone give some hints? > >> > >> On Mar 31, 10:53 am, Simon Knott <[email protected]> wrote: > >> > >> > >> > >> > >> > >> > >> > >> > Ah ignore my message, I've just tested it - in SDK 1.4.2 it throws an > error > >> > and in SDK 1.4.3 it doesn't. Cheers for the info, I should really > have > >> > guessed at that... > > > > -- > > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > [email protected]. > > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
