with bounded buffer