[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Work on 187, 188, 218, .bsh, StructureDeployer

alesj do-not-reply at jboss.com
Tue Nov 20 10:09:41 EST 2007


I'm almost done with tests for this work.
Just two more tests that I have in mind currently and would need some help on how to make them work. :-)

For the single deployment api in MainDeployerImpl, I added a ReentrantReadWrite lock for the following purpose.
All methods that modify existing deployments (all, topLevel, error) have a read lock, except for shutdown, which has a write lock. Meaning you can 'safely' use first methods, since it's up to the user to explicitly remove deployment, where shutdown undeploys them all - regarding how they were added: single deploy or via add/process.
A RRW lock can take multiple read locks and exclusive write lock, so this looks exactly the behavior we're looking for.

What I would like to do, is to test that a single deploy|undeploy and (add|remove)+process don't corrupt each other in multithread requests.
Another test would include a shutdown thread, from where on all other non-shutdown (deploy|undeploy) threads should fail.
The question is how to gather required information, meaning that a thread was legally allowed to go (or not go) past the locks that we've put?


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

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



More information about the jboss-dev-forums mailing list