|
|
|
In this article: Something about me. Something about me.My name is Ilya. I'm 25, from Russian Federation. Now I work as lead programmer in Energotechnica Ltd, and program in Borland Delphi 4/5. Of course, I'm always on the lookout for interesting jobs. I spend much time learning English, so I'll be pleased to receive any comments that could help me to improve my knowledge. I fell in love with Delphi about four years ago and have been programming in Delphi ever since. I also know how to program with VC, Borland C++ and VB, but I do not LIKE it. I find learning C++ Builder a waste of my time since Delphi can do everything that C++ Builder can do. But, however, I LIKE C++ Builder. Thanks go out to Borland for creating such an easy to use and extensible development environment. I plan to write several articles when I can find time during the weekends. I can't pretend to create full course of Borland Delphi, and, really I do not want to do it. There are many people that can do it better. I attach a great importance to reader's feedback and comments. If you think you can offer some interesting theme please e-mail me. Here is the first part of group of articles touching upon creating multithread applications with Borland Delphi. This group will be finished with example of a multithread application. So, let's start. What are multithreaded applications? What are threads?A thread is the basic entity to which the operating system allocates CPU time. You can think of thread as a program that is launched by your application, except that it shares same process address space. On other hand, the thread is a kernel object. Calling CREATETHREAD Win32 API function creates the thread. The thread finishes its execution by calling ExitThread or returning from thread function. After thread finishes execution, object is active until the last its handle is closed by CloseHandle. Each Windows application has at least one thread - the main thread. Main thread is created automatically by system, then user runs application. Then the last thread terminates the process terminates too. Each other thread can force thread termination by calling TerminateThread API function. Please note that TerminateThread is a dangerous function that should only be used in the extreme cases. Why to use threads?Usage of multiple threads can enhance your programs by:
Go To Page: 1 2
The copyright of the article Using threads Part I in Delphi Programming is owned by . Permission to republish Using threads Part I in print or online must be granted by the author in writing.
|
|
|
|
|
|
|
|