Ported & improved concurrency code from CEE