The limit depends on the OS. But if you ask this question, it means that you're doing something wrong: the more threads you spawn, the slower your program becomes. You should have only a few threads, and only if they are really necessary (beginners tend to overuse them).