Hi Jesse,

I do think it all comes down to line 20; and what is being locked ...

Regardless we will hook up both implementations, and stress test them - 
that way we can measure what is better (and if workers end up piling 
up). I only have access to one dual core machine - so we may end up 
asking TOPP to run some tests on their big server?

There are three things being balanced here:
1. Keeping the Cache consistent
2. Making sure two workers do not do the same work
3. Making sure we do not create too many workers to do the same job

With the warning that #3 can never be done; which is why the peek method 
will always be needed after the writeLock. Narrowing the gap between the 
get() method and the writeLock() will result in less workers being 
created for the same job.

Repeat: we will test and be sure, there is no emergency or anything. 
Calm :-)

Cheers,
Jody
> Pretty picture Jody,
>
> I thought that this conversation wasn't crazy enough so I'm throwing 
> my understanding into the mix.  ;-)
>
> Problem that I see with Martin's solution:
>
> Multiple referencing object cannot be created concurrently because 
> line 20 acquires the lock on the table.  Any other thread must have 
> that lock in order to begin creating a referencing object.  Jody's 
> solution allows two Referencing objects to be created in parallel 
> because he is locking on entries rather than on the entire table.  In 
> database land this is like locking an entire table that you want to 
> update rather than just the row that you will update.
>
> Martin:  If you can convince me that your code can satisfy that 
> requirement then you've won me :).
>
> Rephrasing requirement:
>
> CRS1 and CRS2 can be created concurrently.  CRS1 will only be created 
> once.
>
>
> ok shutting up and getting out of the way now.
> Jesse


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to