L
L
lipuha32022-03-23 18:29:13
C++ / C#
lipuha3, 2022-03-23 18:29:13

What logic is implemented inside the task/thread?

Task task = new Task(() =>
{
    
});

As far as I understand, this is called a "thread pool", in which we can control the logic of the thread, how it should behave, etc (correct me if I'm wrong). But I didn’t find the implementation itself, or an example, on the Internet (well, or I found it, but with a too complicated implementation). Can you provide an example of using a thread pool? What logic is written inside?
PS - do not throw an example of a metanit, except for obtaining information about the stream, there are no other ways to implement it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim K, 2022-03-23
@mkvmaks

For example reading a large text file.

F
freeExec, 2022-03-23
@freeExec

From management there is CancellationToken, if suddenly you were asked to stop from outside.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question