Dynamic resource allocation in fork-join queues