On 01/31/2016 11:10 PM, Anthony Walter wrote:
Thanks for the idea Bo. I'll put it near the top of my queue.

+1

IMHO the knowledge about the (great) thread Features of Lazarus are by far not spread wide enough.

The "lesson" should include:

 - Motivation for the usage of threads:
 -     - long winding calculations
 -     - blocking sockets and other hardware / system interface
 -     - exploiting multi-core hardware
 - Different programming Paradigms for Main Thread and Worker Threads
 -     - Main thread: Event driven (never sleep ! )
 -     - one-shot Worker threads
 -     - cyclic Worker Thread
- - - "wake up" e.g. by blocking interfaces,TEvent or CriticalSection
 -     -     - polling with sleep (trading performance against latency)
 - Worker Thread to Main Tread Events:
 -     - TTherad.Synchonize
 -     - TThread.Queue
- - Application.ProcessMessages (IMHO less important since we have TThread.Queue in FPC 3.x) - - using "Event data transport classes" to be used as an argument of TThread.Queue
 - Data integrity
 -     - "Thread safe"
 -     - CriticalSection
 -     - TThreadList
- Creating a Thread pool to prevent overhead for creating and destroying worker threads.
- Advanced:
-      - Threads and DLL/so

...


-Michael

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to