

One TTask.Run for one job to run in parallel. In addition to TParallel, class TTask can be invoke for a more diversified job. TParallel.&For method allow us to run a thread method in loop manner by a range of low and high bound. Parallel Programming Library introduced in RAD Studio are defined in unit. TThread.Queue works similar to TThread.Synchronize in thread safe manner with blocking execution in the executing thread. TThread.Synchronize is blocked until finish execution in the thread. TThread.Synchronize execute codes in main thread if thread safe manner is a concern.

It may serves as a base measurement for application to determine total number of simultaneous running threads in a process. TThread.ProcessorCount is a property that return the number of virtual CPU cores of the runtime process in operating system. TThread.CreateAnonymousThread is a class method allow the creation of simple task embed in an anonymous method to run in thread without the hazard to define a TThread descendant. In most situation, operation that want to perform in thread shall define in TThread descendant and override TThread.Execute method. Most GUI updates performed by thread shall invoke TThread.Synchronize or TThread.Queue.

DELPHI XE10 THREAD SAFE QUEUE CODE
This is a magic return code for the write callback that, when returned, will signal libcurl to pause receiving on the current transfer. The only reason to have a max limit for this is to avoid the risk of a bad server feeding libcurl with a never-ending header that will cause reallocs infinitely The practical minimum is about 400 bytes since libcurl uses a buffer of this size as a scratch area (unrelated to network send operations). We do the ifndef check to allow this value to easier be changed at build time for those who feel adventurous. Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better.
