digitalmars.D.learn - CPU cores & threads & fibers
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (8/8) Jun 14 2015 Hi, just to x-check if I have the correct understanding:
- John Colvin (2/6) Jun 14 2015 Pretty much.
- Etienne Cimon (7/11) Jun 14 2015 Yes, however nothing really guarantees multi-threading = multi-core. The...
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (6/9) Jun 15 2015 Hi, sure. It's more about raising the chance to use the cores ;-)
- Rob T (4/21) Jun 16 2015 FYI:
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (8/12) Jun 18 2015 Thanks. We are currently experimenting to see how want to use the
- "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= (10/14) Jun 14 2015 Fibers/co-routines run on a thread and is conceptually the same
Hi, just to x-check if I have the correct understanding: fibers = look parallel, are sequential => use 1 CPU core threads = look parallel, are parallel => use several CPU cores Is that right? -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Jun 14 2015
On Sunday, 14 June 2015 at 12:35:44 UTC, Robert M. Münch wrote:Hi, just to x-check if I have the correct understanding: fibers = look parallel, are sequential => use 1 CPU core threads = look parallel, are parallel => use several CPU cores Is that right?Pretty much.
Jun 14 2015
On 2015-06-14 08:35, Robert M. Münch wrote:Hi, just to x-check if I have the correct understanding: fibers = look parallel, are sequential => use 1 CPU core threads = look parallel, are parallel => use several CPU cores Is that right?Yes, however nothing really guarantees multi-threading = multi-core. The kernel reserves the right and will most likely do everything possible to keep your process core-local to use caching efficiently. There's a few ways around that though https://msdn.microsoft.com/en-us/library/windows/desktop/ms686247%28v=vs.85%29.aspx http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html
Jun 14 2015
On 2015-06-14 15:54:30 +0000, Etienne Cimon said:Yes, however nothing really guarantees multi-threading = multi-core. The kernel reserves the right and will most likely do everything possible to keep your process core-local to use caching efficiently.Hi, sure. It's more about raising the chance to use the cores ;-) -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Jun 15 2015
On Sunday, 14 June 2015 at 15:54:30 UTC, Etienne Cimon wrote:On 2015-06-14 08:35, Robert M. Münch wrote:FYI: https://issues.dlang.org/show_bug.cgi?id=11686 https://issues.dlang.org/show_bug.cgi?id=11687Hi, just to x-check if I have the correct understanding: fibers = look parallel, are sequential => use 1 CPU core threads = look parallel, are parallel => use several CPU cores Is that right?Yes, however nothing really guarantees multi-threading = multi-core. The kernel reserves the right and will most likely do everything possible to keep your process core-local to use caching efficiently. There's a few ways around that though https://msdn.microsoft.com/en-us/library/windows/desktop/ms686247%28v=vs.85%29.aspx http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html
Jun 16 2015
On 2015-06-16 18:36:09 +0000, Rob T said:FYI: https://issues.dlang.org/show_bug.cgi?id=11686 https://issues.dlang.org/show_bug.cgi?id=11687Thanks. We are currently experimenting to see how want to use the threads and what code to refactor. If we are going to bite the bullet I keep this in mind, maybe we can contribute something along. -- Robert M. Münch http://www.saphirion.com smarter | better | faster
Jun 18 2015
On Sunday, 14 June 2015 at 12:35:44 UTC, Robert M. Münch wrote:Hi, just to x-check if I have the correct understanding: fibers = look parallel, are sequential => use 1 CPU core threads = look parallel, are parallel => use several CPU cores Is that right?Fibers/co-routines run on a thread and is conceptually the same as a functor/object-with-method that can suspend itself and hold onto the state until it is restarted. Like yield in Python generators. Fibers have their own stack, but that is an implementation detail. It is possible to do the same thing with object-method-calls if you have stackless code-generation (D does not support stackless runtimes, but you'll find this in other languages).
Jun 14 2015