work in progress on better consumer/producer pattern for threading