U
U
Unmaskedguy2020-07-19 14:42:00
excel
Unmaskedguy, 2020-07-19 14:42:00

How to set a pool of executable tasks for a form?

So I think you can create some kind of task list in which the tasks that need to be completed before the program closes will be entered, as well as something that would not freeze the main thread and would not conflict with itself every other time?

Problem principle:
There is a Program with classes:
Values ​​- Values
​​Attributes - Attributes
Changable - Changes

There is an Excel file with cells where all values ​​for reading are stored (about 100,000 Lines)

Reading is extremely slow, as for me. In principle, about 10-15 lines are processed per second.
In this case, the longer the reading takes, the slower the program runs.
Set up 2 methods that conflict with each other while the program is running. It is understandable that they refer to one Excel file.

1. Reading cells and creating objects based on them for the output list in the listbox.
2. Writing to the Excel file a line to skip, or its complete removal. And just remove the object from the listbox'a.

PS. So far, I haven’t figured out how to throw out projects here, but if you need the entire source code to solve the issue of the pool of executable tasks, tell me how to lay it out and I will throw out the whole solution here.
PPS:
How do I start Task:

await Task.Factory.StartNew(
                                             () => ReadForm(i),
                                             TaskCreationOptions.LongRunning);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BasiC2k, 2020-07-19
@BasiC2k

Reading and then processing is not a good idea.
Try to read everything into memory first, and then process it all multi-threaded.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question