A1tered / SimpleAntivirus

SAV is a lightweight and Simple Antivirus solution designed to protect Windows computers from potentially malicious activities, files, and processes. This project aims to deliver a simple yet powerful tool that runs quietly in the background, safeguarding your device.
MIT License
1 stars 0 forks source link

Investigate Asynchronous Implications and Conversion #283

Open WithoutAnAccent opened 3 months ago

WithoutAnAccent commented 3 months ago

(Issue pretty much concerns every module)

Main Concerns: Alerts, GUI, Every other module)

I have notable concerns about integration with UI now.

After reading many asynchronous resources, integration with UI is a major concern!

Current implementation of Integrity Checking and File Hash Checking are not asynchronous, they could potentially halt the UI thread. Both modules can run functions in parallel for speed but they do not have Asynchronous functions.

Eg, running of Integrity Checking / File Hash Checking could freeze the program when running scans and what not.

It is assumed that Integrity checking and File hash checking can be scanning simultaneously, another issue arises, Alerts and its reliance on events. Could utilizing Alerts on different threads cause issues (Implications unknown)?

Another notable concern on top of Asynchronous programming is that Events are synchronous and Alerts rely on events. Meaning that If I'm running Integrity Checking scan, the program will HALT to send an alert to Alerts. Meaning that if Alerts is going to do something big then it could halt the scan all together.

I am concerned of the stack call involved here, and want to highlight it and draw more research upon it.

Eg. UI -> Integrity Checking/File Hash Scan -> Scan Files (Loop) -> (Event Raise) -> Alerts -> UI + Database Operations

                                                      (Loop stops to service the Event)

(Whilst it is not a major issue, it must be noted that Alerts should probably never call back into the Main System, eg, Alerts afterwards triggers another Scan or what not)

Major Concerns:

Maybe Considerations (Im no expert but these are considerations):

By doing this, IntegrityChecking/File hash checking only have to worry about adding to Alerts to the queue, and don't have alerts do anything in its thread / stack.`

WithoutAnAccent commented 3 months ago

- [ ] Can WPF update values in the GUI with an Async function loops to infinity, can a loop from 1 to 5 update onto the GUI?

ChristopherTTT commented 3 months ago

Asynchronous implemented in Hash and Integrity at this point in time, however untested.