[fpc-pascal] Re: getting started with threads

Luca Olivetti luca at ventoso.org
Fri Sep 18 09:59:56 CEST 2009


En/na Tobias Giesen ha escrit:

> Also possible but not easier. Threads should not be started or
> stopped for each task, instead they should wait for an event telling
> them to continue with the next task. For example using SetEvent / 
> ResetEvent as well as:
> 
> {$ifdef win32}
> WaitForSingleObject(ContinueEvent,INFINITE);
> {$else}
> RTLEventWaitFor(ContinueEvent);
> {$endif}

There are some cross-platform synchronization classes in syncobjs

http://www.freepascal.org/docs-html/fcl/syncobjs/index.html

Bye
-- 
Luca




More information about the fpc-pascal mailing list