On Sunday 16 July 2017 00:04:48 Fred van Stappen wrote:
> Hello Martin
>
> Some question about MSE threads (tthreadcomp?)...
>
> Mainly how to convert fpc TThread into mse tthreadcomp...
>
> How do you convert this in mse code (+ some tips are welcome)?
>
>
> TMSEthread = class(TThread) ---->  TMSEthread = class(tthreadcomp) ----> ok
> ?
>
tthreadcomp is a container of teventthread which can be placed in a form.
In order to replace a FPC TThread one probably would use tmsethread or one of 
its descendants (tmutexthread -> tsemthread -> teventthread). tmutexthread 
has a mutex, tsemthread a semaphore and teventthread an event queue.

> constructor TMSEthread.Create(CreateSuspended: boolean;
>   const StackSize: SizeUInt) ----> ?
>
   constructor create(const athreadproc: threadprocty;
                const afreeonterminate: boolean = false;
                const astacksizekb: integer = 0); overload; virtual;

> destructor Destroy; override ----> ?
>
   destructor destroy; override;

> procedure Execute; override ----> ?
>
   function execute(thread: tmsethread): integer; virtual;

> procedure DoTerminate; override ----> ?
>
Does not exist, there is tthreadcomp.onterminate and tthreadcomp.onterminated.
> ...
>
> TMSEthread.Start ----> ?
>
tmsethread starts automatically, there is tthreadcomp.active.

> TMSEthread.Queue ----> ?
>
application.postevent(). Often application.lock()/unlock() is more convenient.

> TMSEthread.FreeOnTerminate := true ----> ?
>
tmsethread.freeonterminate:= true;

> TMSEthread.Priority := tpTimeCritical ----> ?

Not implemented.

> ...
>
> About using MSEThreads outside a MSE project...
> Is it possible?

Not easy, it needs the MSE-infrastructure.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to