Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

queue runtime processes how?

Thread view: 
Wernt Me - 11 Jan 2006 20:39 GMT
I need to run an arbitrary number of external executables, with as many as
possible running concurrently.

I have an exaggerated example. Let's say I have a billion processes to create
from arbitrary executables. I want to run the first n that will be able to
run without exhausting storage, then the next n, etc. Each process requires 2
threads one for the process and it's output and the other for it's error
stream.

How can I determine how many processes I should try to create at a time?
Thomas Weidenfeller - 12 Jan 2006 09:15 GMT
> I want to run the first n that will be able to
> run without exhausting storage, then the next n, etc.

This is in general impossible on a garden-variety multi-tasking
operating system. You can't predict how much system memory is available
at a particular time. The millisecond after you get some number, some
other process outside of your control might start and take away memory.

If you want to do things like this - you unfortunately didn't tell us
why you want to do this -, you need an operating system which provides
features for resource reservation in advance. I only know proprietary
OS' for telecom systems who do this.

> How can I determine how many processes I should try to create at a time?

You can't in a reliable way.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Wernt Me - 13 Jan 2006 03:03 GMT
>> I want to run the first n that will be able to
>> run without exhausting storage, then the next n, etc.
>
> This is in general impossible on a garden-variety multi-tasking
> operating system.

I'd be satisfied with determining how many to run at a time, without being
able to predict it.

My first thought is that I can catch out of memory exceptions, but I'm not
sure if it's a good idea to use all of the memory. Maybe I should choose some
fixed number that people can configure.

Essentially, I've been asked to invoke an arbitrary number of external
programs concurrently, for a general tool. My guess is that the number of
programs can easily be more than 100 programs.

Is there a way to be a polite program?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.