in one of my program functions, the function runs a couple of update queries on the database - this takes about a couple hundred milliseconds, but it's enough to cause a perceptible delay in the program. Should I use backgroundworker to run the update queries, or is there a better solution?
Asked
Active
Viewed 25 times
0
-
Do you need to update the UI after the operation? – User 12345678 Jul 22 '14 at 22:06
-
Depending on what you are doing, a `Thread` is another option for you. http://stackoverflow.com/questions/1506838/backgroundworker-vs-background-thread – Kjata30 Jul 22 '14 at 22:06
-
@ByteBlast - No, I don't need to update the UI after the operation. – user3600400 Jul 22 '14 at 22:08
-
You are asking "how to keep the UI responsive while performing some work". This is very basic and has been discussed often. Hope the duplicate helps you. If not, do a web search. If that does not help either, reopen. – usr Jul 22 '14 at 22:09
-
@user3600400 In which case, use a `Thread` or `Task` in a fire-and-forget manner. – User 12345678 Jul 22 '14 at 22:11
-
This article should show you [when to use thread or backgroundworker](http://www.codeproject.com/Articles/628237/Thread-vs-BackgroundWorker) – Chase Ernst Jul 22 '14 at 22:21