question: public void test_multipleResourceLocking_resources10_predeclareLocks_unboundedQueue_locktries10 ( ) throws Exception { final Properties properties = new Properties ( ) ; final int nthreads = 20 ; final int ntasks = 1000 ; properties . setProperty ( TestOptions . CORE_POOL_SIZE , "" + nthreads ) ; properties . setProperty ( TestOptions . NTASKS , "" + ntasks ) ; properties . setProperty ( TestOptions . NRESOURCES , "100" ) ; properties . setProperty ( TestOptions . MIN_LOCKS , "10" ) ; properties . setProperty ( TestOptions . MAX_LOCKS , "10" ) ; properties . setProperty ( TestOptions . MAX_LOCK_TRIES , "10" ) ; properties . setProperty ( TestOptions . PREDECLARE_LOCKS , "true" ) ; properties . setProperty ( TestOptions . SORT_LOCK_REQUESTS , "true" ) ; Result result = doComparisonTest ( properties ) ; assertEquals ( "ndeadlock" , 0 , Integer . parseInt ( result . get ( "ndeadlock" ) ) ) ; assertEquals ( "nsuccess" , ntasks , Integer . parseInt ( result . get ( "nsuccess" ) ) ) ; }
target:  Test where each operation locks one or more resources. <p> Note: This condition provides the basis for deadlocks. In fact, since we have 10 resource locks for each operation and only 100 operations the chances of a deadlock on any given operation are extremely high. However, since we are predeclaring our locks and the lock requests are being sorted NO deadlocks should result. <p> Note: Tasks are not necessarily serialized for this case since there are 100 resources, so even though each task obtains 10 locks it is possible for tasks to have non-overlapping lock requests and therefore there can be more than one task executing concurrently.