Thread overview | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 08, 2016 Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Are there any plans to unite fiber-to-fiber communication with thread-to-thread communication in Phobos? Does vibe.d give any solutions here? |
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | On Friday, 8 April 2016 at 10:51:49 UTC, Nordlöw wrote:
> Are there any plans to unite
>
> fiber-to-fiber communication
>
> with
>
> thread-to-thread communication
>
> in Phobos?
>
> Does vibe.d give any solutions here?
Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago.
|
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote:
> Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago.
1. What functions provide message box communication?
2. But Fibers cannot currently be moved between threads right?
|
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote: > Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago. What progress has been since post: http://forum.dlang.org/post/k4jsef$26h6$1@digitalmars.com |
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | On Friday, 8 April 2016 at 11:18:11 UTC, Nordlöw wrote: > On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote: >> Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago. See https://issues.dlang.org/show_bug.cgi?id=12090 and https://github.com/D-Programming-Language/phobos/pull/1910 for relevant code (as you can see it was merged several releases ago) > 1. What functions provide message box communication? The same ones as thread ones. API is completely transparent. > 2. But Fibers cannot currently be moved between threads right? Yes, and this is by design. It harms performance of concurrent apps. |
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Friday, 8 April 2016 at 13:15:07 UTC, Dicebot wrote:
> On Friday, 8 April 2016 at 11:18:11 UTC, Nordlöw wrote:
>> On Friday, 8 April 2016 at 11:01:21 UTC, Dicebot wrote:
>>> Doesn't std.concurrency support both right now? I remember seeing PR that adds message box support to fibers ages ago.
>
> See https://issues.dlang.org/show_bug.cgi?id=12090 and https://github.com/D-Programming-Language/phobos/pull/1910 for relevant code (as you can see it was merged several releases ago)
>
>> 1. What functions provide message box communication?
>
> The same ones as thread ones. API is completely transparent.
>
>> 2. But Fibers cannot currently be moved between threads right?
>
> Yes, and this is by design. It harms performance of concurrent apps.
So a TId can represent either a thread or a fiber?
|
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote:
> So a TId can represent either a thread or a fiber?
AFAIR, yes (I haven't used std.concurrency in a long while, telling all from memory only).
|
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote:
>
> So a TId can represent either a thread or a fiber?
It represents a "logical thread", which currently consists of coroutines or OS threads but could theoretically be extended to, say, other processes or even other machines.
|
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote:
> On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote:
>> So a TId can represent either a thread or a fiber?
>
> AFAIR, yes (I haven't used std.concurrency in a long while, telling all from memory only).
yes what? Thread or Fiber.
---
Anyway. Since, Fiber is not like a thread, and when a thread starts a Fiber, it is like calling a normal function, I guess TId represents the thread still.
|
April 08, 2016 Re: Fiber and Thread Communication | ||||
---|---|---|---|---|
| ||||
Posted in reply to tcak | On Friday, 8 April 2016 at 19:46:17 UTC, tcak wrote:
> On Friday, 8 April 2016 at 15:33:46 UTC, Dicebot wrote:
>> On Friday, 8 April 2016 at 14:08:39 UTC, Nordlöw wrote:
>>> So a TId can represent either a thread or a fiber?
>>
>> AFAIR, yes (I haven't used std.concurrency in a long while, telling all from memory only).
>
> yes what? Thread or Fiber.
Yes both :) Tid represent abstract execution context, with no implications about underlying executor.
|
Copyright © 1999-2021 by the D Language Foundation