Single-Threaded Concurrency: Thread Loops and Agents