-
Notifications
You must be signed in to change notification settings - Fork 757
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
Add warning when windows defender delays supernova boot #4984
Add warning when windows defender delays supernova boot #4984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! just a few changes.
@@ -0,0 +1,2 @@ | |||
void startServerBootDelayWarningTimer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add #pragma once
to the top of this file, and move the comment from the top of the cpp file to this file instead. header files are typically the place where API documentation goes. you could also add a quick note about how these two calls are used if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks !
common/SC_ServerBootDelayWarning.cpp
Outdated
static bool g_isServerBooted = false; | ||
static std::mutex g_scsynthBootWarningMutex; | ||
static std::condition_variable g_scsynthBootWarningConditionVariable; | ||
static std::thread* g_bootWarningThread; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be a std::thread
-- the default constructor (number 1 here) doesn't start a real thread of execution. then you can assign to it with g_bootWarningThread = std::thread(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in modern C++ (C++11 and newer), using new
and delete
directly is almost always a bad sign. there are several ways of avoiding it -- unique_ptr and shared_ptr among them -- that are not only semantically clearer, but also safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! I had not read the section about "utilities" in "A tour of C++" yet. A lot of things have changed (in a good way) since my old days in C++ :)
common/SC_ServerBootDelayWarning.cpp
Outdated
|
||
static bool g_isServerBooted = false; | ||
static std::mutex g_scsynthBootWarningMutex; | ||
static std::condition_variable g_scsynthBootWarningConditionVariable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything using scsynth
in its name should now use server
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah of course !
common/SC_ServerBootDelayWarning.cpp
Outdated
std::cout << "On some Windows-based machines, Windows Defender sometimes "; | ||
std::cout << "delays server boot by one minute." << std::endl; | ||
std::cout << "You can add scsynth.exe and/or supernova.exe *processes* to "; | ||
std::cout << "Windows Defender exclusion list to disable this check. It's safe." << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider changing disable this check
to avoid this delay
-- it's unclear what this check
refers to, and because of that, not entirely clear that disabling it means that the delay will go away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
…r#4984) * add warning when supernova boot is delayed by Windows Defender, follow up to supercollider#4941 * temporarily enable appveyor artifacts to test on windows * trying endl instead of \n * remove artifacts generation from appveyor * various changes after Brian's code review
Purpose and Motivation
This is the followup to #4941 (thanks for guiding me @brianlheim).
It displays a warning message for Windows users when supernova takes longer than 10 seconds to boot, which may come from Windows Defender scanning all the UGens.
Manually tested :
[X] Message is displayed if supernova takes more than 10 seconds to boot
[X] Message is not displayed if supernova takes less than 10 seconds to boot
[X] Message is displayed if scsynth takes more than 10 seconds to boot
[X] Message is not displayed if scsynth takes less than 10 seconds to boot
Types of changes
To-do list
Please squash the commits if you merge this PR !