I don't see the use of threads in practice. Everything I've read states that threads allow two different operations to appear to happen at the same time. But every time I've tried to get that to happen it doesn't do anything special. For example, say I want to write a simple test for threads that shares two loops.

Thread 1: FOO
Thread 2: BAR
Thread 1: FOO
Thread 2: BAR
Thread 1: FOO
Thread 2: BAR
Thread 1: FOO
Thread 2: BAR
Thread 1: FOO
Thread 2: BAR

This is what I expect when someone says synchronized execution. But all of my tries with _beginthread and _endthread end up like this.

Thread 1: FOO
Thread 1: FOO
Thread 1: FOO
Thread 1: FOO
Thread 1: FOO
Thread 2: BAR
Thread 2: BAR
Thread 2: BAR
Thread 2: BAR
Thread 2: BAR

I don't need threads to do that. So I'm obviously missing something big, can someone show me how to do what I want using threads? I've read a lot on MSDN but that's not really much help.