version with futures instead of thread pool - but still with java-style wait/notify