my goal is to understand what happens when t := tmthread.create(i); is called
TThread is just a class like any other.
Create() is its constructor (just like with most other classes). You have to create an object instance of the class in memory before you can use it. No different than any other class.
why the tmthread,create doesn't need to be passed 'ch'
my understanding : tmthread.execute is in the tmthread class so it gets all of tmthread class variables?
Yes. You pass a value to your class's constructor, which stores that value in a member variable, which is accessible to all methods of the class. No different than how any other class works.
why the need for separate tmthread.create and tmthread.execute 'objects'? (procedure tmthread.create and consturctire tmthread.create ?)
They are not 'objects'.
Create() is a constructor,
Execute() is a procedure method.
Where
TThread differs from other classes is that its
Execute() method is always called in the context of a dedicated worker thread that is different than the thread that calls the constructor.
You do know what is a
thread is, don't you? If not, you need to go study up on that. Any decent programing book should cover that topic.
can they be combined into one constructor/procedure?
No.
Create() creates the class object in memory, and then creates a worker thread that calls
Execute() on that object.
and what the inherited create(false) really means.
The
base TThread constructor has a boolean parameter named
CreateSuspended:
public constructor TThread.Create(
CreateSuspended: Boolean;
const StackSize: SizeUInt = DefaultStackSize
);
Your derived class's constructor is calling the base class's constructor, telling it to create its worker thread in a non-suspended state, ie the thread starts running as soon as it is created (well, after the constructor exits, anyway).
Sometimes, you may need to set
CreateSuspended to True instead, to delay the thread from running until you explicitly call
TThread.Resume() or
TThread.Start(). Typically, you do this when you need to perform additional initializations after the constructor exits on things that the thread needs to access. Or, if you want to create a pool of reusable threads that are resumed and suspended on-demand.