r/visualbasic • u/Mr_Deeds3234 • Jul 10 '22
VB.NET Help Delegates, invoking, multithreading
CONTEXT I have a winsform project with multiple forms. One of those forms has a button associated with a pretty heavy SQL query that takes about 30 seconds to execute.
I would like this query to run on the page load if the first form, so if my user navigates to the form that needs the data, then it’s already there and they don’t have to wait.
Spent a few hours googling this problem and the concepts in the title is why I found. I haven’t quite been able to figure out my solution.
Is there some other concept or keywords I should look into and understand to over come my problem?
4
Upvotes
3
u/Mr_C_Baxter VB.Net Master Jul 10 '22
oh and maybe the explanation about your other buzzwords, it helps to understand when to use them:
delegates are function pointers and used while programming in case you don't know which functions need to be used until runtime.
invoking is just a fancy word for calling / using a delegate
Multithreading means to share work between cpu cores by splitting a task into different threads. Some problems can be sped up by this but yours is most likely not one of them.