[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Concurrent deployments

adrian@jboss.org do-not-reply at jboss.com
Tue Feb 12 10:28:31 EST 2008


"bela at jboss.com" wrote : The MC's dependency management currently starts all services sequentially, according to their dependencies.
  | 

Actually some services, e.g. MDBs are started asynchronously,
but this is handled by the relevant container rather than the Micro-kernel/container.

anonymous wrote : 
  | In JBoss 4.3, we have 4 JGroups channels, which take 5 secs *each* to start. However, they are completely independent from each other, so they could be started concurrently. This would bring the time needed down from 20 secs to 5 secs.
  | 
  | I imagine we could do this for all independent services, a.k.a subtrees in the dependency tree. This would speed up start of JBoss significantly !
  | 
  | Can we do this ?
  | 


This question has been asked many times before.
The answer is in principle yes, but in practice no.

The main the practicality problems are:

* Not all services define their dependencies properly. It's only the implicit 
sequential order that makes them work correctly.

* The Sun classloading doesn't work very well concurrently. We avoid a number
of potential problems by doing a sequential load of most of the key classes
during the bootstrap.
We have workarounds, but you can still see these issues on some
platforms.

* The "big ball of mud" unified classloader depends for consistency/predictability
on having the classloaders created in order. It is this order that is used to
search for global classes. If these were registered concurrently across threads
the search order would be unpredicatble across different reboots.
In fact, 4.x has no mechanism for classloading dependency at all.

* The old 4.x MicroKernel has some thread safety issues,
e.g. invocations of create/start are done in synchronized blocks which could
cause deadlock problems, there are others related to ConcurrentModificationExceptions.
This is not an issue with the 5.x Microcontainer.

* We'd need to find a way for the BarrierService and "Server Started" notification
to know when all the startup threads have finished, otherwise
they would be broken.

* Finally, less of a practical issue, but more a generic note. Using mulitple threads
for startup will only work if there are multiple cpus/cores. In non SMP environments
the bootstrap could be slower with multiple competing threads, although
it may be able to take advantage of times during disk I/O waits
to do some processing on other threads?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128809#4128809

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128809



More information about the jboss-dev-forums mailing list