Game Development Community

Processes...?

by Ricky Taylor · in Torque Game Builder · 04/01/2006 (5:45 am) · 9 replies

Hey... Its me again...

Well... I'd like to know where the check for already running processes is...

And, how I could start a process inside of T2D...

Thanks in advance.

#1
04/01/2006 (6:51 am)
In scripting, all you have to do is :

$evt = schedule(time_in_miliseconds, reference_object, "function_name_wo_parenthesis",parameters);

so :

function echoHeartBeat()
{
echo("Heart Beat");
$evt = schedule(1000,0,"echoHeartBeat");
}

will create a thread that runs every second. To cancel it do :

cancel($evt);

Where $evt was set during the schedule function and points to the next scheduled event

HTH
#2
04/02/2006 (1:39 pm)
I want to clarify something here based on terminology:

Torque Game Builder is not thread friendly, and Bruno's comment above is a bit misleading: using schedule does not create a new thread that runs every second. It simply adds a Simulation Event to the SimEvent queue to be executed (roughly) 1 second in the future.
#3
04/04/2006 (3:43 pm)
I want to clarify something here based on terminology:

De ja vu?

A process is not a thread.

Process:
An executable in memory, currently being run.

Thread:
A strand of an executable in memory, creating a new thread will not allow me to overwrite T2D.exe.


Secondly, my first (and most important) point hasnt been answered... =. (
#4
04/04/2006 (5:06 pm)
@Ricky--fair enough (I was responding to Bruno's post, not your original one), but your question is extremely non-specific, to the point of being difficult to answer:

Quote:
Well... I'd like to know where the check for already running processes is...

Which check do you mean? Which processes do you mean?

Quote:
And, how I could start a process inside of T2D...

Are you wanting to fork off a new instance of the running application? Start up a completely unrelated application? You can't start a process (see your definition above) "inside of" another process--you can request from the operating system that another process be spawned, but that's not what you asked exactly, so it's hard to get a response to that.

Finally, in your last message you say "starting a new thread will not let me to overwrite T2D.exe"...that's the first we've heard of this requirement, and why would you want to do that in any case? The reason behind wanting to do that may (or may not) change the method in which you do it.
#5
04/05/2006 (8:25 am)
@Stephen:

I was replying to Bruno also, I jsut used your line because I thought it was also applicable.


Quote:but your question is extremely non-specific

Mmmm...?

I am asking where the code that stops multiple instances of the release T2D exe. What word was I supposed to use instead of process, mmm?

And I wanted nothing to do with threads, I am making an auto-update feature for T2D, it is required that I overwrite T2D.exe in the filesystem (which requires T2D not to be running).

I plan to copy the new T2D to T2D.new, and run that.

The old exe will terminate and the new one will copy itself onto T2D.exe, it will restart itself and delete T2D.new.

Yes? I can do this in C# (my stonger language), and I am quite good with C++, I just wondered if there were some platform inspecific functions I could use (in T2D).

As for the "Inside of T2D" I meant, that I can start the process in C++, or TourqueScript, rather than making the user do it.

Im sorry if I came across as perhaps mean in my last post... I was trying to point out the difference between a thread and a process...
#6
04/05/2006 (8:39 am)
Your original question was very non-specific. But now we know what you are looking for.

As for checking multiple instances, search for excludeOtherInstances().

As for starting a new process, that's a pretty platform specific task, but look into openWebBrowser() for a starting point.
#7
04/06/2006 (7:27 am)
Quote:As for starting a new process, that's a pretty platform specific task

Exactly!! Thats why I wondered if anyone knew of these functions. Also openWebBrowser may use another method. I have a hunch, but thnx owen.
#8
04/06/2006 (7:40 am)
I have this thread bookmarked for a windows only solution: www.garagegames.com/mg/forums/result.thread.php?qt=20580
#9
04/06/2006 (10:42 am)
Quote:Sorry, only members who have purchased the following products may access this discussion:

Grumbles, I really need to buy TGE, just to read the TS docs... lol

Anywho, I have solved it says I.... Now I have runProgram(file, args); and maybe if/when I release this I can get some linux enthusiast (like me) to fix it for other OSes.