Hello,
just some more words concerning threads on windows...
Green threads are called Fibers under Windows. If you want to limit your OS
thread usage, you can use another JVM such as JRockit for example that
provides a "many-to-one" mapping of Java-Threads to OS-Threads. With this
JVM, I have been able to create several thousands of server and/or client
sockets in the same JVM while only consumming about 9 OS threads.
Cheers,
Sacha
> This is not a "weak" implementation. It is simply an implementation
> choice. On Intel hardware, you are effectively limited to about 4000
> threads, which is the default in Windows. If you need to do so, you can
> increase the number of task slots available in Linux by editing
> "include/linux/tasks.h" in the kernel source and recompiling.
>
> The important constants are NR_TASKS, which defaults to 512, and
> MAX_TASKS_PER_USER, which defaults to NR_TASKS/2. Assuming you are
> running jBoss under a dedicated system user account, you can set NR_TASKS
> to something like 4000 and NR_TASKS_PER_USER to something like 3800, and
> then you will get substantially the same behavior on Linux as you would on
> Windows. Note, however, that this does not _guarantee_ stability of the
> system on either Linux or Windows, but simply raises the bar before jBoss
> wedges itself and has to be killed externally by the operating system.
>
> Linux is designed with these low defaults on the assumption that any
> process that is creating hundreds of threads is going crazy and should be
> halted, so this ordinarily improves system stability. In the case of
> jBoss/Tomcat, it is normal behavior to see hundreds of threads created,
> and the assumption embodied in the Linux kernel defaults is inapplicable.
>
> One option you do not have with Windows that you do have with Linux is to
> set the installed JVM to use "green threads" instead of "native
> threads."
> This will use an internal scheduler in the JVM to switch between threads,
> and they will not consume system task slots. Green threads are somewhat
> less efficient than native threads in most cases, but you may get better
> stability by using them under very heavy load. One disadvantage to green
> threads is that, on SMP hardware, all threads within a JVM will be
> confined to a single processor, while with native threads different
> threads in the same JVM can run simultaneously.
>
> You would be well advised to upgrade to JDK/JRE 1.3.1, which has some
> improvements. You may also want to see that Java is started with the
> "-Xincgc" switch, which spreads out the garbage collection penalty and
> prevents major bottlenecks from developing that can cause avalanche.
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user