Any way to run a JAVA prog in background? (like SETI)

Does anyone know if it's possible to have a java program only run during otherwise idle cpu cycles?
I have a program which does an awful lot of number crunching, and needs to run for long periods of time. Ideally I want it to function in the same way as programs like the Search for ExtraTerrestrial Intelligence (SETI) program or cancer research programs, in so far as they will only run when the cpu has little else to do, thereby not hogging all my system resources when I need to do something else.
Failing that, is there a way to make my program resumable? i.e, is there some way to save the exact execution state of the program on exiting, and have it resume from where it left off at a later date?
Any help would be much appreciated.

Yes, but not by using Java.
Unfortunately, Sun and its key developers have decided to hide behind the rhetoric of claims of lack of portability as a means to avoid providing a full and complete programming solution, forcing people like me, who have to write code that really does run everywhere and really does do sophisticated things to implement our own solutions beyond Java - this is one of those (thankfully few) times when you must do so.
I am working on a code-set of some twenty five thousand lines of Java (or more - NONE of that including GUI code!) that also has to handle such concerns. Our solution is to use operating system tools to solve this problem. We have settled on the unix paradigm for our solutions, primarily because there are (now) unix or unix-like solutions available for every computer operating system that has at least a 1% installed base or market share of existing boxes out there today. For Windows, we have our customers use CYGWIN - check it out, it's good stuff. For Apple, you've now got OSx...
Note also that you may wish to break your threads away from user interaction. For this, we use "nohup" - a part of the unix paradigm! Works great but you must be sensitive to the fact that you have to point the tool at a log-file, and there are miscellaneous rules for that logfile... Pay attention to such issues and a solution isn't very hard.
...Oh, one more thing: To launch your code from a running Java thread you must beware of how Java captures the runtime environment and, in short, makes your life miserable. A good solution for this is to run a "shell script" that then does what you want, completely outside of Java. This has the advantage of letting YOU choose the run-time environment variables that are or are not set, and what their values are, instead of letting Java constrain you. ...Note that we use this technique for going TO Java FROM Java! We just use a but of operating system help in the middle! WORKS GREAT!
I hope this helps.
Regards,
Richard

Similar Messages

  • Is there any way to run signcode.exe program under background mode

    Hi everyone,
    I am finding the solutions to build the project automatically but the situation is still unchanged. When building the project i have use the signcode tool to sign my .cab files therefore the system shows me the "Enter Private Key Password" dialog and ask me to enter my password into the Password field.
    If all you guy have any ways for packing the project by the mechanism of the running signcode program under background mode. Below is my script.
    [b]signcode -spc ms.spc -v ms.pvk -n abc.cab -i URL -t http://timestamp.verisign.com/scripts/timstamp.dll abc.cab
    Thank you for your ideas and regards
    Tan

    Hi,
    you can use the tool signcode-pwd to automate the signing:
    http://www.stephan-brenner.com/blog/?page_id=9

  • Is there a way to make Illustrator save in the background, like Photoshop?

    Out of Photoshop, InDesign and Illustrator, Illustrator is definitely the one I have most problems working with, due to small UI differences and ways of handling things
    Like the fact that you can't drag next to a number to change it, like in Photoshop. Or the fact that I can't sync my settings (it only says "Signed in as:", and when I press Manage Account, I'm taken to my CC files in Safari).
    But most annoying is the fact that whenever I'll save a document in Illustrator, a dialogue box opens letting me know the progress of the saving. Not only does this make me unable to continue working on the document (if the file is large, it takes some time), the app icon starts jumping in the dock if I switch to another program before the box appears.
    So, is there any way to make it save in the background, like in Photoshop? I'm running OS X, with Illustrator version 17.1.0.

    This really frustrates me, small differences between the apps that shouldn't be there.
    I understand you can't change the keyboard shortcuts to be the same/similar, but this is totally different. Let's hope it changes soon.

  • Running another java prog from a java program

    hi,
    I would like to add a button to my program in which when pressed, it will launch another java program.
    so far i googled and found out how to run from this site:
    http://www.devx.com/tips/Tip/13867
    but when the 2nd program is launched, the first program become inaccessible until the 2nd program is terminated.
    is there any way to run the program without causing the first program inaccesible? thank you

    run the commands in seperate threads.
    http://java.sun.com/docs/books/tutorial/essential/threads/

  • Is there any way to write a Java prg without main()

    I would like to know Is there any way to write a Java program without using main() function.

    > i am unable to execute the program ..............i
    think there must be a main method through with the
    program starts
    The program can be compiled and run. After running it, you'll see "They'll kill you for that" followed by something like "java.lang.NoSuchMethodError: main" and finally someone with a big Volvo will burst into your room and runs you over.

  • Is there any way to run abap program in dialog process with process chain?

    Hi.
    I just want to run custom abap program in every 30min.
    so I made process chain and connect abap program.
    but it returns NOTHING when background running.
    the program has ABSOLUETLY no problem when it's running DIALOG process.
    custom program is modified from sap standard program for my use.
    so complicated and hard to read that I cann't figure out what's problem in backgound job and even hard to debug in background process.
    is there any way to run abap program in dialog process in every 30 min.?
    or call BSP page or call function.
    any solution will be helpful that excuting PROGRAM or FUNCTION or BSP PAGE in schedule job and should running dialog process.
    thanks.
    Lee.

    Hi,
    did you try using sm36 transaction?
    1Give these values in Gereral data
    Create one sample job "SAMPLE JOB"
    Priority "A"
    Execu target - Your application server
    2Click start conditon
    schedule according to ur requirements.
    3.Click Step button
    Give your ABAP program name.
    fill variants if it has any variants.
    if it is useful assign points
    Regard,
    Senthil Kumar.P

  • Is there any way to run Classic on an Intel mini running Tiger?

    Due to space limitations, I'm having to retire my old faithful Powermac 6500. It's hard to believe that it's 10 years old. It's running OS8.6, and can run OS9 even though it seems slow and memory intensive.
    Is there any way to run Classic mode on my Intel Core Duo mini? It's hardly a matter of life and death, but I still have several older Mac-based games like Railroad Tycoon II and Myst that I enjoy, and they won't run on the newer mini.
    If space wasn't a problem, I would keep the old machine running just to play games, but it's not possible now.
    Any assistance would be appreciated.
    Thank you,
    -Bill

    The only way is to install (free) emulator programs such as BasiliskII or SheepShaver.
    I have both installed, though I only use them to run older programs to rescue old data from obsolete formats.
    Installing and configuring them is not trivial, unfortunately.
    Links here:
    http://basilisk.cebix.net/
    http://gwenole.beauchesne.info/projects/sheepshaver/
    I don't know if either is suitable for the kind of games you want to play. Graphics is typically where emulators fall behind. But again, I have no experience with those games.

  • Is there any way to run a report from database?

    Is there any way to run a report from database using trigger?
    A report needs to be printed out when a new row is inserted into a table.

    If you are using the Reports Server it is possible to start a report from a trigger by using the UTL_HTTP package (in the sys schema) to call the report URL. This should work with DESTINATION=PRINTER.
    Hope this helps.

  • Is there any way in photoshop cc to eliminate the background in the program like in cs5.1 ??

    is there any way in photoshop cc to eliminate the background in the program like in cs5.1 ??

    Is this with a Mac system?  If yes, then Window > Application frame, or so I believe.

  • Any way to see ios exchange email user picture like in outlook on my iphone?

    Any way to see ios exchange email user picture like in outlook on my iphone?

    There are 2 ways that the contacts are being pulled down to your phone/tablet with Exchange.  Your personal contacts (those created in Outlook) will pull down any picture that you have uploaded to it (be cautious of the file size on these as the initial sync will take a long time to pull these down) - and it appears nicely for caller ID and such.
    If you are talking about the Global Address Book lookup - this is a setting that is in both Exchange and AD that could be preventing this.  Our company has turned this off for privacy concerns - and they have restricted the size limits on the pictures (this was overloading some of the other collaboration clients for those that had numerous people in their groups - like Lync or SharePoint).
    We have suggested that people who want pictures of co-workers create a personal contact card for them and attach them there.  We are using Exchange 2010 SP3 in this scenario.

  • Is there any way to check another Java program running status?

    HI. I want to write a Java program on hand-set but my program seems needs lots of resources and if there is another Java program running on the same hand-set simultaneously, my program will slow down. So, I want to check if there is another Java program is running on the hand-set, my program will show a message to user reminding user to close another program first.
    Is there any way to do so?

    On most recent devices, the application is not terminated but paused by using phone functions, and can be reactivated from the aplication management software. The javax.microedition.midlet package documentation is quite specific, if a tad obscure, about the MIDlet lifecycle and the role of the MIDelt methods vis-a-vis the AMS.
    {color:#0000ff}http://java.sun.com/javame/reference/apis/jsr037/javax/microedition/midlet/package-summary.html{color}
    Parenthetically, I've never been able to figure out how resumeApp should be used, nor have I seen this method invoked in any of the samples that come with the WTK, but I haven't gone through all of them.
    I believe the still-in-progress MIDP3 will make it possible to have MIDlets that share the screen with native apps and which can be minimized and restored.
    db

  • How to run a java prog from c prog

    hello all
    I wanted to run a java class from a c prog,
    can any body suggest the way in which this can be done, links or tutorials in this regard is highly appreciable,
    thanks in advance
    Message was edited by:
    mahima_vyas

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • Any way to run the processor before the compiler throws an error?

    Hi,
    I want to generate code for an annotation @OverrideAll that would implement all the interface I methods with some default body.:
    Example
    interface I {
      void method();
    @OverrideAll
    class A implements I {
    }would have to generate code like this:
    class A_gen implements I {
      public void method() {
    class A extends A_gen {}However, I have the problem that the original source file does NOT compile because the interface I is not implemented, and as such, the annotation processor never runs. My question is:
    Is there any way I could force the annotation processor to run before the compiler shows the error? Or at least some way to supress this error message and give a chance to the annotation processor to run?
    TIA,
    Gabriel

    belingueres wrote:
    Hi,
    Thanks for answering so soon.
    I would prefer not to name the generated class in the original source code. As an alternative I thought to rather generate a subclass, but then there is the instantiation problem (can´t do it without creating a factory method in class A and making it abstract, and indeed again need to name the generated class):
    @OverrideAll
    abstract class A implements I {
    public static A create() {
    return new A_gen();
    // generated class
    class A_gen extends A {
    public void method() {
    }so it seems I reached a dead end here.
    It would really help if (using the superclass generation as originally posted) I could change in the processor the superclass of class A to be A_gen, but it would require AST rewritting and I guess it is not a good option (if at all possible.)Belingueres,There are two ways to do what you want. You can either generate a superclass of A, or a subclass of A.
    If you generate a superclass, you need to specify the generated superclass's name in the extends clause of A. But you said "I would prefer not to name the generated class in the original source code", but give no reasons then go off exploring the second alternative.
    If you generate a subclass of A, then you need a way for the rest of the code to instantiate As without really knowing about the subclass, so you do in fact need a factory method in A which actually returns A_gens.
    I suggest you revisit your preference for not naming the generated class, and work out why you have that preference, and whether it is actually a sound engineering constraint, an aesthetic nicety (maybe in terms of not wanting the implemention strategy to be brought to the surface) or something emotional.
    You can do what you want with annotation processing, but you must choose between naming the generated superclass in the extends, or having an factory method that names the subclass.
    A related issue is that if you generate the superclass, the annotation processor can pick up the name of the class to be generated from the "extends" clause, and you therefore don't need to specify it any other way, whereas if you generate a subclass, the annotation processor cannot infer the name of the subclass that is being instantiated from the factory method (unless you use non standard APIs in your annotation processor), which means you need to explicitly name it as an attribute of the annotation.
    I have a preference for generating a superclass because that imposes less restrictions on whatever else you do with the class, and less of the code generation implementation details leak up into the class's signature.
    Also note when generating a superclass, if you want to extend something other than Object, then you need to specify that as an annotation value, usually as a Class<?>.
    Bruce

  • Is there any way to run the Symbian Anna applicati...

    hello 
    i have nokia 500 belle refresh i want to run the app's that run only on symbian anna like astroller and stellarium mobile though all are astro apps but i want them on my this device ie on symbian belle refresh 
    pls tell me the way to run these app on this phone as it have all the hardware requirments like GPS and Gryroscope,Magnetometer etc 
    pls tell any possible way to downgrade nokia 500 to anna or just freshly installed symbian anna OS in it 
    i am ready to do anything for these star gazing app also suggest some star gazing app that can run on this mobile using agumented reality 
    actualy all want to run astroller or star chart like apps

    What version are you trying to run
    V4 works fine with Belle Refresh
    http://store.ovi.com/content/51773?clickSource=search&pos=2
    if you are having problems then try contacting the publisher
    www.heliotropesoftware.com 
    [email protected]

  • Any way to run AGP and onboard video? k7n2g

    I wanna use my GF3-Ti500 and the IGP!!! Any way??
    Thanks!

    Quote
    backwoodz wrote: AGP Accelerated Graphics Port..........1 agp per north bridge........either external or internal......but only 1 per north bridge
    The latest AGP spec (3.0) supports multiple AGPs as an option.  Unfortunately, you don't seem to hear about this nearly as much as you hear about 8x transfer rate.  
    The bigger problem of course, is that no manufacturers seem to be taking advantage of this capability.
    nforce2 400 is the next "chipset" version, which should start showing up within a couple of months, but most likely won't have this feature either.
    With any luck, maybe we'll see dual (integrated + add-on) AGP when nforce3 (or whatever they decide to call it) hits the scene.  I wouldn't hold your breath, though.
    nvidia?  anyone listening?  Here's a great way to sell integrated graphics on enthusiast boards!  
    P.S. - throw in DVI adapter capability while you're at it  8)

Maybe you are looking for

  • Access MS Access database on remote computer (shared folder)

    Hello, I need some help. I've made a program and it works fine on my computer, but multiple users will be using program simultaneously, each one on his own computer conected over local network to mine computer (database is on my computer in shared fo

  • Warning message during inter-company sales process.

    Hello Gurus, We are changing plant manually right? while creating an order for Inter-company sales process. As soon as we change the plant, system should give a warning message. Regards Rikin.

  • JDBC classes too large

    I created an applet just to test to execute the sqlj statements. The entire applet is using java classes except for the registration of oracle driver which is using the oracle classes. DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver

  • Trouble loading shutterfly website & uploading from Iphoto

    All of a sudden my iMac can't load the website www.shutterfly.com.  It tries to load but eventually just times out. This has been going on for over 2 weeks. As a result, I can't evenget to the shutterfly landing page to log into my account and I can'

  • Trying Remote Console causes reboot...

    On some of my users' workstations, when I attempt to remote control, the workstation reboots and I get a 1853 error. Anyone heard of this...? Thanks in advance... Delon E. Weuve Senior Network Engineer Office of Auditor of State State of Iowa