|
|
|
|
|
by hornetblack
3727 days ago
|
|
One advantage is spinning up new green threads can be very quick. Starting a new Kernel thread requires at least 1 syscall. For example: on a network service, you have 1 thread listening for new connections, when a new connection is made. It starts a new thread, which calls the handler. The listener thread then goes back to listening for new connections. Now the advantages can depend on your green threading implementation. If a listener thread blocks on reading from Disk or a DB. Then the listener thread can still wait for new connections and other connection handlers can still operate. Making you network application responsive, without increasing latency on clone syscalls. Of course you can achieve this in other ways. |
|