Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: "Multithreading, the Delphi Way, Part II" - topic list?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Feb 10, 2017 11:24 PM Last Post By: Tom Brunberg Threads: [ Previous | Next ]
Martin Harvey

Posts: 1
Registered: 6/28/13
"Multithreading, the Delphi Way, Part II" - topic list?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2013 12:28 PM
Apologies if this is the wrong group - it's not entirely NativeAPI, not entirely VCL / FireMonkey, and it's not Off-topic either. Suggestions for a better group also welcomed.

I'm working on Part II of a tutorial I started long ago, specifically considering design patterns for Multithreaded apps that are meant to be highly scaleable. A very provisional table of contents is shown below. I would welcome suggestions for any specific issues / patterns that new / improving users find to be of difficulty. I specifically want to deal with "context free" ways of doing multithreading, thread pools, and the many changes and improvements in Win32 and other API's since the last tutorial was written, specifically affinity handling, APC's, NUMA memory allocation etc.

Anyone have any specific comments on my ToC, and thoughts on what else might go in?



Table of Contents:

Chapter 0: Introduction and background, target audience, material to cover, which API?
Chapter 1: Lightweight synchronization: interlocked operations.
Chapter 2: Using interlocked ops to build a state machine. Synchronization problems are just topology.
Chapter 3: Concepts borrowed from the kernel: Work items, queues and thread pools. Thread stealing and context dependence.
Chapter 4: A Delphi Work item implementation using interlocked ops.
Chapter 5: A Delphi Queue implementation using interlocked ops.
Chapter 6: A Delphi Thread pool implementation using interlocked ops.
Chapter 7: Win32 API. What's changed since Windows 2000 and why?
Chapter 8: The Win32 API Thread pool functions.
Chapter 9: More interlocked ops, acquire, release and fence semantics.
Chapter 10: Interlocked list functions and the SRW lock.
Chapter 11: Faster I/O: Asynchronous Procedure Calls.
Chapter 12: Faster I/O: Overlapped operations – more reasons to use interlocked state machines.
Chapter 13: Faster I/O: I/O Completion ports and NUMA handling.
Chapter 14: Putting it all together – asynchronous nirvana!
Chapter 15: Other platforms: Win64, iOS, Android.


Martin Harvey.

Alf Christopher...

Posts: 25
Registered: 10/10/98
Re: "Multithreading, the Delphi Way, Part II" - topic list?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2013 7:40 AM   in response to: Martin Harvey in response to: Martin Harvey
On 30.10.2013 20:28, Martin Harvey wrote:
Apologies if this is the wrong group - it's not entirely NativeAPI, not entirely VCL / FireMonkey, and it's not Off-topic either. Suggestions for a better group also welcomed.

I'm working on Part II of a tutorial I started long ago, specifically considering design patterns for Multithreaded apps that are meant to be highly scaleable. A very provisional table of contents is shown below. I would welcome suggestions for any specific issues / patterns that new / improving users find to be of difficulty. I specifically want to deal with "context free" ways of doing multithreading, thread pools, and the many changes and improvements in Win32 and other API's since the last tutorial wa
s written, specifically affinity handling, APC's, NUMA memory allocation etc.

Anyone have any specific comments on my ToC, and thoughts on what else might go in?


Table of Contents:

Chapter 0: Introduction and background, target audience, material to cover, which API?
Chapter 1: Lightweight synchronization: interlocked operations.
Chapter 2: Using interlocked ops to build a state machine. Synchronization problems are just topology.
Chapter 3: Concepts borrowed from the kernel: Work items, queues and thread pools. Thread stealing and context dependence.
Chapter 4: A Delphi Work item implementation using interlocked ops.
Chapter 5: A Delphi Queue implementation using interlocked ops.
Chapter 6: A Delphi Thread pool implementation using interlocked ops.
Chapter 7: Win32 API. What's changed since Windows 2000 and why?
Chapter 8: The Win32 API Thread pool functions.
Chapter 9: More interlocked ops, acquire, release and fence semantics.
Chapter 10: Interlocked list functions and the SRW lock.
Chapter 11: Faster I/O: Asynchronous Procedure Calls.
Chapter 12: Faster I/O: Overlapped operations – more reasons to use interlocked state machines.
Chapter 13: Faster I/O: I/O Completion ports and NUMA handling.
Chapter 14: Putting it all together – asynchronous nirvana!
Chapter 15: Other platforms: Win64, iOS, Android.

Martin Harvey.


Perhaps a chapter on how to use Enterprise modelling tools (UML-2) for
describing usage of semaphores and other signals for sychronising
threads, especially when the threads do very different jobs, but need to
be syncrhonized on certain steps.

I use the Activity diagras and for each thread, a separate swinlane and
showing different activiites along the swimlanes and use signal send and
signal receive to describe the points for synchronizations, like waiting
for a semaphore set by another thread

Make it easily visible to show where the threads may be interlocked etc.
etc.

--
Delphi programmer at Dep.of Nutrition research, Faculty of Medicine,
University of Oslo, Norway
http://www.med.uio.no/imb/personer/adm/achristo/index.html

Roland Kossow

Posts: 77
Registered: 9/23/99
Re: "Multithreading, the Delphi Way, Part II" - topic list?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 5, 2014 2:25 AM   in response to: Martin Harvey in response to: Martin Harvey
Hi - Just read this.
Part 1 of your tutorial is awesome.
Chapter 6 and 15 is what I am most intrested in.
If you want to send me what you have got so far, I would be happy to give you feedback.

Thanks a lot already for part 1 of your tutorial.
Kent Foong

Posts: 36
Registered: 8/1/00
Re: "Multithreading, the Delphi Way, Part II" - topic list?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2014 9:03 PM   in response to: Martin Harvey in response to: Martin Harvey
Martin Harvey wrote:
Apologies if this is the wrong group - it's not entirely NativeAPI, not entirely VCL / FireMonkey, and it's not Off-topic either. Suggestions for a better group also welcomed.

I'm working on Part II of a tutorial I started long ago, specifically considering design patterns for Multithreaded apps that are meant to be highly scaleable. A very provisional table of contents is shown below. I would welcome suggestions for any specific issues / patterns that new / improving users find to be of difficulty. I specifically want to deal with "context free" ways of doing multithreading, thread pools, and the many changes and improvements in Win32 and other API's since the last tutorial was written, specifically affinity handling, APC's, NUMA memory allocation etc.

Anyone have any specific comments on my ToC, and thoughts on what else might go in?


Table of Contents:

Chapter 0: Introduction and background, target audience, material to cover, which API?
Chapter 1: Lightweight synchronization: interlocked operations.
Chapter 2: Using interlocked ops to build a state machine. Synchronization problems are just topology.
Chapter 3: Concepts borrowed from the kernel: Work items, queues and thread pools. Thread stealing and context dependence.
Chapter 4: A Delphi Work item implementation using interlocked ops.
Chapter 5: A Delphi Queue implementation using interlocked ops.
Chapter 6: A Delphi Thread pool implementation using interlocked ops.
Chapter 7: Win32 API. What's changed since Windows 2000 and why?
Chapter 8: The Win32 API Thread pool functions.
Chapter 9: More interlocked ops, acquire, release and fence semantics.
Chapter 10: Interlocked list functions and the SRW lock.
Chapter 11: Faster I/O: Asynchronous Procedure Calls.
Chapter 12: Faster I/O: Overlapped operations – more reasons to use interlocked state machines.
Chapter 13: Faster I/O: I/O Completion ports and NUMA handling.
Chapter 14: Putting it all together – asynchronous nirvana!
Chapter 15: Other platforms: Win64, iOS, Android.

Martin Harvey.


Are you still working on this tutorial? It sounds interesting having seen the TOC.Is it available for reading now?
Martin Harvey

Posts: 2
Registered: 7/19/00
Re: "Multithreading, the Delphi Way, Part II" - topic list?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 6, 2017 12:59 PM   in response to: Kent Foong in response to: Kent Foong
Part II now available at

http://www.martincharvey.tk/
Tom Brunberg

Posts: 329
Registered: 12/27/04
Re: "Multithreading, the Delphi Way, Part II" - topic list?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 10, 2017 11:24 PM   in response to: Martin Harvey in response to: Martin Harvey
Martin Harvey wrote:

Part II now available at

http://www.martincharvey.tk/

Thank you Martin!

--
Tom Brunberg
firstname.lastname@welho.com
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02