M
mark
Hello,
I have just built an application (J2SE) which creates many threads for
I/O socket operations. Under very specific circumstances (very slow
network connection, many I/O operations) I got an error:
Exception in thread "main" java.lang.OutOfMemoryError: unable to create
new native thread
Therefore I am just wondering is it possible to put all the threads to
some finite queue (which size would be specified by the operating
system) so that it could execute only some of the threads keeping the
rest in the queue (FIFO preferably). All the threads are independent so
there should be no problems with blocking. I just wanted to do so just
to improve my performance and avoid such errors in very specific cases.
Would be very grateful for help.
Best, Markus
I have just built an application (J2SE) which creates many threads for
I/O socket operations. Under very specific circumstances (very slow
network connection, many I/O operations) I got an error:
Exception in thread "main" java.lang.OutOfMemoryError: unable to create
new native thread
Therefore I am just wondering is it possible to put all the threads to
some finite queue (which size would be specified by the operating
system) so that it could execute only some of the threads keeping the
rest in the queue (FIFO preferably). All the threads are independent so
there should be no problems with blocking. I just wanted to do so just
to improve my performance and avoid such errors in very specific cases.
Would be very grateful for help.
Best, Markus