|
|
|
|
|
- Overview
- From simple management to advanced management of threads
WINDEV and WINDEV Mobile propose several functions used to perform an advanced management of threads. Threads allow running code (or processes) in parallel with the main application. Therefore, several processes can be run in the background without locking the main application. Threads replace some types of timers. An efficient thread is a thread that waits for an event such as a user action, an incoming email, an incoming phone call, etc. Examples for using threads: - Retrieving emails in the background while entering a new email, for example.
- Communication application: managing phone calls, communication via sockets, etc.
From simple management to advanced management of threads WINDEV proposes several features for managing threads: - Running threads.
For more details, see Thread execution - Managing the semaphores in the threads, which means limiting the simultaneous execution of a code by one or more threads at a given time. A semaphore can be shared between several applications.
For more details, see Managing semaphores in threads: limiting the concurrent execution of lines of code. - Managing the mutexes in order to limit the simultaneous execution of a code to one thread at a given time. A mutex can be shared between several applications.
For more details, see Managing mutexes in threads. - Managing the critical sections in order to limit the simultaneous execution of a code to one thread at a given time in a single application.
- Managing events to synchronize several threads.
For more details, see Synchronizing threads via events.
Related Examples:
|
Unit examples (WINDEV): The threads
[ + ] Using threads in an application: - Run a procedure in thread format - Stop a thread - Run a procedure that expects parameters in thread format
|
|
Unit examples (WINDEV Mobile): The threads
[ + ] Using threads in an application: - run a procedure in thread format - stop a thread - run a procedure that expects parameters in thread format
|
|
Unit examples (WINDEV): The threads (pool)
[ + ] Using threads: - Running processes started in parallel - Limiting the number of threads in execution at a given time Reminder: A thread is a process running in parallel to the current application (main thread). This allows you to run a task in background task for example (backup, ...). Threads are very useful in the industry: supervisor, applications with real-time process check, and so on …
|
|
Training (WINDEV): WD Using sockets
[ + ] This example presents the use of the "Socket" functions of WINDEV in Client/Server. The following topics are presented in this example: 1/ How to connect to a socket 2/ How to accept a request for connection 3/ How to write or read on a socket Summary of the example supplied with WINDEV: This example presents the different functions for socket management supplied with WINDEV. To use this example, a first instance of the example must be started in "server" mode. Then, by specifying the name of the computer that will be used as server and a nickname, you can connect to this application in "client" mode. You now have the ability to send messages to all the connected users. In this example, a thread and a socket are associated with each connection.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|