xLeaves
07-08-2019, 11:22
LzRPA's multitasking system is perfected as Redis' full suite of features is developed.
Now select the multi-threaded project in the Create Engineering interface.
You can create an application that contains task features.
9985
Tasks can be controlled, including starting tasks, suspending tasks, restoring suspended tasks, and terminating tasks.
9986
Because the task function is simulated using multiple processes, there is no need to worry about the release of resources. As the process disappears, all occupied resources are automatically released by the system.
But this also brings some shortcomings, such as the difficulty of exchanging data between multiple processes.
My solution is to use Redis, I compiled the Win32 version of Redis Server, and developed a set of HiRedis libraries available for ThinBasic.
When the main process starts, the Redis server will be created (random port). When the task starts, the port will be passed as a parameter to the task, and the task will connect to this port.
Whether it is the main process or the task process, a Redis object named G is created, and data is written and read to G to complete data exchange between multiple processes.
Another advantage introduced by Redis is that the application written by ThinBasic is capable of multi-machine deployment.
9987
Now select the multi-threaded project in the Create Engineering interface.
You can create an application that contains task features.
9985
Tasks can be controlled, including starting tasks, suspending tasks, restoring suspended tasks, and terminating tasks.
9986
Because the task function is simulated using multiple processes, there is no need to worry about the release of resources. As the process disappears, all occupied resources are automatically released by the system.
But this also brings some shortcomings, such as the difficulty of exchanging data between multiple processes.
My solution is to use Redis, I compiled the Win32 version of Redis Server, and developed a set of HiRedis libraries available for ThinBasic.
When the main process starts, the Redis server will be created (random port). When the task starts, the port will be passed as a parameter to the task, and the task will connect to this port.
Whether it is the main process or the task process, a Redis object named G is created, and data is written and read to G to complete data exchange between multiple processes.
Another advantage introduced by Redis is that the application written by ThinBasic is capable of multi-machine deployment.
9987