|
|
|
|
|
Note: These functions are also available in prefix syntax ( Functions for managing threads (prefix syntax)). The following functions are used to manage threads:
| | CriticalSection | Activates a named critical section or variable in a USE ... IN instruction. | CriticalSectionEnd | Marks the end of a critical section: another thread will be able to run the code. | CriticalSectionStart | Marks the beginning of a critical section: no other thread will be able to run the code as long as the current thread does not exit from the critical section. | EventChange | Modifies the status of an event. | EventClose | Closes a synchronization event between several threads. | EventCreate | Creates an event. | EventDestroy | Explicitly destroys an event. | EventOpen | Opens a synchronization event between several threads. | EventWait | Locks the current thread while waiting for the specified event to be opened. | ExecuteMainThread | Triggers the execution of the procedure specified in the main application thread. | ExecuteMainThreadAsynchronous | Executes a procedure in the main thread of the application without waiting for the end of its execution. | MutexCreate | Explicitly creates a mutex. | MutexDestroy | Explicitly destroys a mutex. | MutexEnd | Signals that the thread frees the mutex. | MutexStart | Locks the current thread while waiting for the mutex to be freed. | SemaphoreCreate | Creates a semaphore. | SemaphoreDestroy | Explicitly destroys a semaphore. | SemaphoreEnd | Allows one or more threads to exit from the area protected by the semaphore. | SemaphoreStart | Locks the current thread until the semaphore is opened (which means until a "free" spot becomes available in the protected section). | ThreadCurrent | Returns the name of the thread currently run. | ThreadEnd | Ends the execution of the current thread. | ThreadExecute | Starts the execution of a secondary thread. | ThreadMode | Changes the management mode of threads. | ThreadPause | Pauses the current thread during the specified duration. | ThreadPersistent | Makes a thread persistent. | ThreadPriority | Returns or modifies the priority level of a thread. | ThreadRequestStop | Sends a stop request to a thread. | ThreadResume | Resumes the execution of a thread that was interrupted by ThreadSuspend. Function not recommended. | ThreadSendSignal | The current thread sends a signal to the specified thread in order to unlock it. | ThreadState | Returns the current status of a thread. | ThreadStop | Stops a secondary thread. Function not recommended. | ThreadStopRequested | Checks if a stop request has been sent to the running thread. | ThreadSuspend | Temporarily suspends the execution of the specified thread. Function not recommended. | ThreadWait | Waits for the end of the execution of the specified thread. | ThreadWaitSignal | Locks the current thread until it receives a signal from another thread. | You also have the ability to use the following types of variables:
| | AutomaticEvent | The AutomaticEvent type is used to manage an automatic event. | ManualEvent | The ManualEvent type is used to manage a manual event. |
Related Examples:
|
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
[ + ] 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.
|
|
Complete examples (WINDEV): WD FTP File Transfer
[ + ] WD FTP file transfer This example is a full FTP client allowing you to store several FTP servers. Then, you have the ability to perform multi-file transfers from the local computer to the server or from the FTP server to the local computer. To do so, we are using the standard functions of WLanguage (FTPConnect, etc...)
|
|
Android (WINDEV Mobile): Android Persistent Notifications
[ + ] This example is used to create persistent notifications that appear even if the application is not used anymore. A persistent thread run when the starting device is used to send the notifications.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|