SRL Archive - General

I figured out how to multy-thread.


R0b0t1

2007-12-08 23:11:03

I know how to do it, but you have to guess first. :rolleyes:

Infantry001

2007-12-08 23:35:21

ISM (InterScarMessage)?

Pyro

2007-12-09 05:13:39

settimeout…

I win :P

Wizzup?

2007-12-09 05:15:09

Using SCAR's TFORM thread.
BTW: Do you mean IN scar?

danrox2004

2007-12-09 05:26:35

For two threads you can use setTimeout (I think) and threadSafeCall and the main thread.

mastaraymond

2007-12-09 06:25:40

In one scar its , as far as i know.., not possible..

SetTimeOut (Doesn't work..)
TTimer (Im not really sure, it gave me some errors, i think thats the only possible way to do it.. TTimer.Create(nil) in SafeCallThread mode)

In delphi it is very possible yes, Markus made a example multi-thread plugin already.. :o


EDIT:

Ok, got it working.. One problem, Pausing, doesn't work.. Since it only pauses the main thread, and not the SafeCallThread..

program New;
var
Form : TForm;
Timer : TTimer;
Arr : TVariantArray;
Const
Interval = 1000;
Procedure Test(Sender : TOBject);
begin;
Writeln('Multi-Threading..');
end;

Procedure SafeCallMe(Inteverval : integer);
begin;
Form := CreateForm;
Timer := TTimer.Create(Form);
Timer.ONTIMER := @Test;
Timer.INTERVAL := Inteverval;
end;

begin
Arr := [Interval];
ThreadSafeCall('SafeCallMe',Arr);
Wait(5000);
FreeForm(Form);
end.

R0b0t1

2007-12-09 11:34:01

An application has a main thread, and it can create as many threads as it wants. Each thread takes a 1KB stack size…

There are two ways to do it, ISM, or you make a simple C++ or Delphi DLL.


ISMing would be the easiest, as you could have it wait and sync it with your main thing. I'm pretty sure someones done it before (Wizzup?). But I didn't know about the form thing though, but it might not be too useful unless each form in Delphi gets its own thread.

Markus

2007-12-09 11:58:53

That's not real multithreading.
Real multithreading is like there are functions in scar like CreateThread, KillThread, PauseThread, SynchronizeThread etc.
The only one that comes close in scar is the form trick.

R0b0t1

2007-12-09 21:21:30

Yes, it is multithreading. I'm using multiple threads.

Boreas

2007-12-09 23:49:02

ISM isn't really practical for things like watching for randoms the whole time, but it works well for moving the mouse while continuously checking uptext (perfect quiet fast find bank ftw!).