Comment #14 on issue 183 by mccu...@gmail.com: Scopes.SINGLETON uses a global lock
http://code.google.com/p/google-guice/issues/detail?id=183

Just want to add an empirical observation: I've not yet seen any problems in the field (duplicates or deadlocks) caused by using a finer-grained lock - however I have seen several real-world deadlocks caused by the current coarse-grained lock. And while people can add selective synchronization around specific injector requests (or higher in the call chain if they prefer) when using the instance lock, the only way to avoid the coarse deadlock is to extend global locking further across the entire application. (This issue is much more apparent when you have multiple injectors running in the same classloader space.)

Is the global (class) lock the only solution? Is there any way to use an instance lock at the low-level and solve potential duplicates by selectively locking at a higher level in the injector? That would then avoid the current problem with the global lock affecting multiple (unrelated) injectors that just happen to be in the same classloader.

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to google-guice-dev@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to