Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have 5 Group Box in my software I want to run them differently for example I have one group box which takes lot of time around 20-30 minutes till then my software hangs. SO I want to make other functionality working when a particular group box is working any solution for it?
Group boxes don't "work". If they're just some GUI for a resource intensive task, you probably want to run that task asynchronously (or multi-threaded, depending on your requirements) and only use the GUI for settings / updates / whatever. The key is to never do much work on the GUI thread - if a GUI action takes more than say 50-100ms, it should probably be done elsewhere. Note that using await makes this very easy to do properly - if that's not available, a BackgroundWorker is probably the best option. Do note it doesn't shield you from synchronization issues, though!
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I display some of the data i.e. Sum, Average and Total on a page and want to update them after the data changed using SignalR. Most of the examples uses the following approach that broadcast all of the clients after create / update / delete methods (that change data) are executed:
private void BroadcastDataChange(Data data)
{
Clients.All.dataChanged();
}
However, I am wondering if there is a smarter approach that let me update the data i.e. periodically refreshing without broadcast in each of the create-update-delete methods (I do not use SqlDependency, etc, juts using SignalR). On the other hand, I am not sure this kind of approach is contradictory to the SignalR logic. This is the first time I use SÄ°gnalR and I am too confused :( Any help would be appreciated.
You can use polling with SignalR. It's just an inefficient way of doing things though, because: (1) there would be a delay between when changes happen and when they are broadcast to clients. (2) broadcasts would happen even if data didn't change, which is a waste of resources.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a real time video processing application running on Windows 7/10 that has 4 distinct processing steps. Each of these steps is currently running in a WPF Task and I have eliminated copying of the video data as much as is possible, I am down to two copy operations. The capture of the video and the subsequent storing of the video is handled by a COM-based SDK. Would I see an increase in performance if I turned each of the steps into a separate exe and use a shared memory scheme to move the data between the exe's? Or rather than use WPF Tasks, use threads? Anyone have hard data on something like this?
Thanks,
Doug
Q: Will breaking a Windows 10 app into multiple exe's improve concurrency?
This question is very wide/broad, but as a generic answer: No
Parallel/concurrent performance is based on Windows scheduler which is based on threads and their priorities. It means that processes do not matter. You can have 10 processes with 1 thread each or 1 process with 10 threads. They all will be scheduled the same way. (Almost, with some exceptions which affect priorities, but not directly overall performance.)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have created a console program that transfers data from a database to a server. This program must run every day at a certain time. At first I thought of a scheduled task but the problem is that it depends on a user being logged in. However, as it is rather tricky and the service has to run every day, I came to the Windows service through my research.
However, most of the information comes from 2009 and 2010 and may already be outdated? I also found a guide explaining how to create a scheduled service:
https://www.aspsnippets.com/Articles/Simple-Windows-Service-that-runs-periodically-and-once-a-day-at-specific-time-using-C-and-VBNet.aspx
Is that still best practice to do it that way? What would you recommend?
Your first thought was right, use a scheduled task and select the 'Run whether user is logged on or not'.
If you use a Windows Service you have to code the trigger yourself which could be fraught with errors.
If you'd like something more 'enterprise' I'd suggest looking at Quartz.NET. It's an open source scheduling library, although it's probably overkill for what you're trying to achieve.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have been told to make a process that insert data for clients using multithreading.
Need to update a client database in a short period of time.There is an application that does the job but it's single threaded.Need to make it multithread.
The idea being is to insert data in batches using the existing application
EG
Process 50000 records
assign 5000 record to each thread
The idea is to fire 10-20 threads and even multiple instance of the same application to do the job.
Any ideas,suggestions examples how to approach this.
It's .net 2.0 unfortunately.
Are there any good example how to do it that you have come across,EG ThreadPool etc.
Reading on multithreading in the meantime
I'll bet dollars to donuts the problem is that the existing code just uses an absurdly inefficient algorithm. Making it multi-threaded won't help unless you fix the algorithm too. And if you fix the algorithm, it likely will not need to be multi-threaded. This doesn't sound like the type of problem that typically benefits from multi-threading itself.
The only possible scenario I could see where this matters is if latency to the database is an issue. But if it's on the same LAN or in the same datacenter, that won't be an issue.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm developing a C# program that needs to be able to schedule a variety of asynchronous tasks at different times. I need a solution that activates every second to check for tasks to execute, and eats up as few resources as possible. It also needs to scale well to a large number of tasks. Which of these is better to use, or is there any ?
1) Using a System.Timers.Timer object with a 1 second elapsed time to trigger an event that executes tasks, or
2) Using a separate thread that sleeps for 1 second and then executes tasks when it wakes up, or
3) Something else entirely.
System.Threading.Timer is extremely lightweight. You could create a separate timer for each task so that the timer comes due when the task is supposed to execute.
Internally, I believe that the system will keep track of what timer is due next so it only has to monitor one timer at any given time (source/similar question).
Try looking at Quartz.Net for your scheduling needs. I think it's pretty good.