B
B
beduin012015-10-11 13:38:37
Multithreading
beduin01, 2015-10-11 13:38:37

What is a heavy and an easy task for a thread?

I deal with threads and fibers (lightweight threads). As I understand it, fibers do not require content switching, and due to this, several hundred fibers can work in one thread. All this is good only as long as they (these fibers) perform some simple tasks such as sending queries to the database.
I have a question. Where is the line between simple and difficult task. Sending data is supposed to be a simple task, but which task will be more difficult? Where is the line between one and the other?
How to determine how many fibers can be put into one thread?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-10-11
Protko @Fesor

when a thread is executed, it is destroyed by the system task scheduler, while fibers are an implementation of cooperative multitasking (that is, only one fiber can work within one thread and they constantly switch and let each other work a little).
First, understand the implementation and the differences between processes, threads, and fibers, and then most of your questions will disappear. For example, you can start with a wiki

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question