User Tools

Site Tools


ch2_1_wait

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
ch2_1_wait [2022/02/25 00:15] adminch2_1_wait [2024/05/05 10:54] (current) admin
Line 18: Line 18:
 The process currently in the waiting loop will be reported in the process list as "waiting", normally running processes are reported as "running". Since normal processing is usually quite fast, the user mostly sees the "waiting" processes only. The process currently in the waiting loop will be reported in the process list as "waiting", normally running processes are reported as "running". Since normal processing is usually quite fast, the user mostly sees the "waiting" processes only.
  
-The mechanism behind waiting and LabLISP multitasking is following: When multiple LabLISP eval processes are running in the environment, the process control evals one expression at a time in each process, before moving to the next process. The LabLISP environment runs in separate thread from the main Qt application, but all the LabLISP eval processes run in the same thread, so the LabLISP multitasking is an emulation. When all processes are in the waiting loop, the environment slows down and the Qt/C++ thread sleeps in total 100 ms on each cycle. The 100 ms is splitted between the evaluations of the waiting conditions, so - for example - if we have four waiting processes, the process control evaluates the waiting condition in first, waits 25 msec, evaluates the condition on second, waits 25 msec, third, waits 25 msec, fourth, waits 25 msec, before returning back to first. +The mechanism behind waiting and LabLISP multitasking is following: When multiple LabLISP eval processes are running in the environment, the process control evals one expression at a time in each process, before moving to the next process. The LabLISP environment runs in separate thread from the main Qt application, but all the LabLISP eval processes run in the same thread, so the LabLISP multitasking is an emulation. When all processes are in the waiting loop, the environment slows down and the Qt/C++ thread sleeps in total 10 ms on each cycle. The 10 ms is splitted between the evaluations of the waiting conditions, so - for example - if we have four waiting processes, the process control evaluates the waiting condition in first, waits 2.5 msec, evaluates the condition on second, waits 2.5 msec, third, waits 2.5 msec, fourth, waits 2.5 msec, before returning back to first. 
  
 This LabLISP behavior is bit experimental and arbitrary, and might lead to weird results if there would be processes with simple conditions together with others having complex waiting conditions. The actual Qt/C++ sleep is called only after the evaluation of the condition returns T, but the evaluation of the condition might need several eval calls and the process control switches between the processes after individual evals. So the evaluation of the complex condition will be slowed down by the repeated sleep calls in the other other processes, where it will happen more frequently due to simple conditions there. This LabLISP behavior is bit experimental and arbitrary, and might lead to weird results if there would be processes with simple conditions together with others having complex waiting conditions. The actual Qt/C++ sleep is called only after the evaluation of the condition returns T, but the evaluation of the condition might need several eval calls and the process control switches between the processes after individual evals. So the evaluation of the complex condition will be slowed down by the repeated sleep calls in the other other processes, where it will happen more frequently due to simple conditions there.
ch2_1_wait.1645773329.txt.gz · Last modified: 2022/02/25 00:15 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki