ECJ-INTEREST-L Archives

June 2008

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Sun, 1 Jun 2008 14:21:49 -0400
MIME-version:
1.0 (Apple Message framework v753)
Reply-To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=US-ASCII; delsp=yes; format=flowed
Subject:
From:
Sean Luke <[log in to unmask]>
In-Reply-To:
Content-transfer-encoding:
7bit
Comments:
To: ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (46 lines)
You'd need to implement it yourself.  Another approach you could do  
is have it listen on a port and flag a variable to inform you that  
you should die when an accept occurs.  Maybe create a thread like this:

public boolean pleaseDie = false;
public void makeKill()
	{
	Thread t = new Thread(new Runnable()
		{
		public void run()
			{
			StreamSocket sock = new StreamSocket(5000);
			sock.accept();
			pleaseDie = true;  // don't bother to synchronize
			}
		});
	t.start();
	}

Then to die you could just do:

	telnet localhost 5000

Another approach you could use is to interrupt the control-c signal  
in Unix.  Java can't trap signals by default.  But googling for "Java  
signals" gives lots of stuff on how to handle it using JNI.  Not a  
happy approach, but...

Sean


On Jun 1, 2008, at 12:36 PM, Shane wrote:

> Okay.  Is there an external way to send a running ecj process a  
> message to stop?
>
> Here is an simple example of how I could do this:
> I could have ecj poll periodically for a file named "stop.txt" on  
> the filesytem and if it exists, it would call Evolve.cleanup(state)  
> and System.exit(0).  Then anytime I want to stop ecj, I just create  
> the stop file and then delete it after ecj has stopped.
>
> Is there currently a way to stop ecj using a similar technique or  
> do I need to implement this myself?  Also, if I need to do this  
> myself, can you think of a better way to do it than the example above?

ATOM RSS1 RSS2