concurency

Notifying consumer when producer is done

I'm reading in a lot of data from ldap which needs to be compared to the respective records in the database. To minimize the number of SQL queries, I want to batch multiple ldap records into a single query. All this is pretty simple: A thread to produce ldap results, and a thread to consume those results and run the SQL query. ldap_...

synchronized(Object) { } problems

I have ran into a perfomance problem where 880 threads are doing synchronized() { method() } in the same time and this has lead to a major perfomance problem. Is it possible that there is some limit of threads waiting at synchronized()? Where can I get the limit? Another question is what is best to put into synchronized( ? ). Because ...

java.util.concurrent : calculating primes

Hi all, I'm new to the package java.util.concurrent. I've created the following program testing if a number is a prime using a multi and a monothreaded strategy. import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class IsPrime implements Runnable { private static final long UPPER...