smallroomsoftware.com

Java Concurrency in Practise - essential reading!

Posted on July 22, 2008

Just finished reading Java Concurrency in Practise and I'd highly, highly recommend it. This book quickly scares you into thread-safety seriously! It contains a lot of information relating to Java's memory model that you're unlikely to pick up from the javadoc (without a lot of effort anyway) and is written really, really nicely. Definitely increased my appreciation for Java and for how well optimised the JVMs are nowadays.

XGridJob class

Posted on August 31, 2006

Might save someone an hour or so. Just a simple Java class to invoke the command-line xgrid client on OS X. You can add files to send with the job. There's a pure java xgridclient library but it seems to leak a thread every time a job is submitted (somewhere in the BEEP implementation). I emailed the author but got no reply so I wrote this simple class to invoke Apple's client.

Usage example:

XGridJob job = new XGridJob("host.domain",
                            "script.sh");
job.addFile(new File("script.sh"));
job.submit();
while (!job.resultsAvailable()) {
    Thread.sleep(500);
}
String results = job.getResults();
job.dispose();

Download the class...

Hosting by site5.com