polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Merlin <p...@nosphere.org>
Subject Re: [qi4j-dev] Using Qi4j as a skeleton framework in a high throughput, highly concurrent servlet deployment (and problems with race conditions)
Date Sat, 04 Apr 2015 10:27:59 GMT
Hi Tasos,

module.newTransientBuilder() and module.newValueBuilder() are
implemented in org.qi4j.core.runtime.ModuleInstance, they both rely on
TypeLookup in the same package, should be thread-safe, on each call they
return a new Builder instance.

Using putIfAbsent() in TypeLookup would mean that the type-lookup should
be done on each call. That would defeat the actual caching of
type-lookup and, from what I understand, not solve any synchronization
issue. With the actual code, under immediate pressure, the lookup can be
executed a few times before caching is effective but this should not
cause any race-condition. With Java 8 we'll be able to use
computeIfAbsent() to optimize this, will do in 3.0.

Would it be possible for you to build a sample program that showcase the
I know it's quite difficult when it comes to concurrency issues ... but
it's also hard to narrow it down without such a showcase.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message