Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When there are multiple threads in the program, the log will be blocked and the program will be too laggy #50

Open
wssf812 opened this issue Aug 12, 2023 · 3 comments

Comments

@wssf812
Copy link

wssf812 commented Aug 12, 2023

Q:When there are multiple threads or coroutine in the program, the log will be blocked and the program will be too laggy?

The specific problem is that the log printing time of a module is very long, and all threads feel that it is too laggy. What is the reason for this, how should it be resolved, and are there specific parameters to modify?
log example:
module one:time 120s
module two:time 240s
Similar to this, it actually takes a few seconds, and then it will be blocked for a long time

@alexsilva
Copy link
Owner

On Windows, the behavior of the supervisor is a little different because the APIs are different. It operates in a non-blocking single loop and the only way found so far to control the speed at which this loop works is with the option

delaysecs option

@alexsilva
Copy link
Owner

I haven't stopped to research a better solution, but without a main loop sleep it will make the cpu run at 100%. On Unix systems this is somewhat resolved with socket.select

Time sleep

@wssf812
Copy link
Author

wssf812 commented Aug 14, 2023

On Windows, the behavior of the supervisor is a little different because the APIs are different. It operates in a non-blocking single loop and the only way found so far to control the speed at which this loop works is with the option

delaysecs option

Thank you for your reply. I'll give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants