How to set limit to the number of Thread that someone can create? What I do is running someone's code (something like ideone), and want to limit number of thread that he can spawn. How to do so? Some jvm setting or something else?
EDIT I add more specified info because some people are not gettin my point.
- Some random guy send me a code which my computer is going to execute
- Code must be execute within using maximum of k threads
- All must be automated - working like SPOJ, ideone, etc.