In this case it is a good idea, before starting the thread, to disable the buttons of the form to avoid the user starting more than one thread for the job.Īnother use of multi-threading may be a server application that is able to respond to many clients at the same time. If the big job runs in a second thread, the application keeps responding (almost) as if it were idle. and while processing, the screen stops responding, and gives the user the impression that the application is frozen, a poor or misleading impression will be created. If you create an application, and when the user presses a button the application starts processing a big job. The main idea is that the application can do some processing in background in a second thread while the user can continue working using the main thread.Īnother use of threads is just to have a better responding application. The Main Thread must be the only thread that updates the components that interfaces with the user: otherwise, the application may hang. The Main Thread is the one that is created by the Operating System once our application starts. One of the threads is called the Main Thread. If you are new to multi-threading, please read the paragraph "Do you need multi-threading?" to determine whether it is really required this may save you many headaches. A multi-threaded application is one that creates two or more threads of execution that work at the same time. This page will try to explain how to write and debug a multi-threaded application with Free Pascal and Lazarus. 9.1 Using SendMessage/PostMessage to communicate between threads.8 Debugging Multi-threaded Applications with Lazarus.3 Units needed for a multi-threaded application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |