digitalmars.D - Actor model & D
- =?UTF-8?B?Ikx1w61z?= Marques" (5/5) Aug 18 2013 Can anyone please explain me what it means for the D language to
- Tyler Jameson Little (9/14) Aug 18 2013 I assume this refers to task in std.parallelism and the various
- Andrei Alexandrescu (3/17) Aug 19 2013 Go is CSP - isn't that different from Actor?
- deadalnix (3/5) Aug 19 2013 I'd be interested to know the difference.
- Russel Winder (34/35) Aug 19 2013 CSP certainly is very different from actors, it's in the synchronization
- Bienlein (20/25) Nov 05 2013 To my understanding "Message Passing Concurrency" in D is already
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (9/10) Nov 05 2013 Going totally off topic here, there is ownerTid in every worker's
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/13) Nov 07 2013 Done:
- Sean Kelly (9/36) Nov 05 2013 uages
- Bienlein (2/5) Nov 08 2013 That would be awesome. Something similar to lightweight threads
- =?UTF-8?B?Tm9yZGzDtnc=?= (2/7) Nov 11 2017 Has someone implemented this?
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (5/14) Nov 11 2017 I have a PR open for vibe.d to add Go style channels:
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (4/9) Nov 11 2017 The page is largely unverified, i.e. nobody cares that it is full
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (9/9) Nov 11 2017 When I come to think of it, browser based Javascript might be
- Dmitry Olshansky (4/14) Nov 11 2017 Wat? std.concurrency is message passing where an actor is either
- Ola Fosheim Grostad (4/20) Nov 11 2017 That's a library and it does not have much to do with actors,
- Dmitry Olshansky (7/29) Nov 11 2017 So what? Should we say that c doesn’t support threads because
- Ola Fosheim Grostad (8/16) Nov 11 2017 Regular C is not a concurrent language.
Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languages
Aug 18 2013
On Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesI assume this refers to task in std.parallelism and the various bits in std.concurrency for message passing. I'm very surprised that D made the cut but Go didn't. I'm even more surprised that Rust was included even though it's not even 1.0 yet while Go is at 1.1.1 currently. I wish they had some kind of explanation or code examples to justify each one as in other articles, because I'm also very interested...
Aug 18 2013
On 8/18/13 9:24 PM, Tyler Jameson Little wrote:On Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Go is CSP - isn't that different from Actor? AndreiCan anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesI assume this refers to task in std.parallelism and the various bits in std.concurrency for message passing. I'm very surprised that D made the cut but Go didn't. I'm even more surprised that Rust was included even though it's not even 1.0 yet while Go is at 1.1.1 currently. I wish they had some kind of explanation or code examples to justify each one as in other articles, because I'm also very interested...
Aug 19 2013
On Monday, 19 August 2013 at 16:20:37 UTC, Andrei Alexandrescu wrote:Go is CSP - isn't that different from Actor? AndreiI'd be interested to know the difference.
Aug 19 2013
On Mon, 2013-08-19 at 09:20 -0700, Andrei Alexandrescu wrote: [=E2=80=A6]Go is CSP - isn't that different from Actor?CSP certainly is very different from actors, it's in the synchronization structure. Go's model isn't CSP per se, it is a more or less the same thing developed by Pike over the years. At it's coarsest: An actor processes a message from it's message drop as and when it wishes and send messages to other actors it know the message drop for asynchronously. Processes in CSP rendezvous in order to pass messages down a one-to-one channel, which has no buffering. Modern CSP allows one-to-one, one-to-many, many-to-one and many-to-many channels with or without buffering. CSP processes with many-to-one channels with large buffering can appear very like actors. Actors that are effectively event loops can be made to look an awful lot like CSP. The are different but there are shades of grey (no not that sort of activity :-) so it is easy to see how people might get confused. The third player here is dataflow, and this is increasingly used for "Big Data" and might be worth thinking about in std.parallelism. An operator (a process as in CSP, but the whole model comes from 1970s dataflow computer research hence operator) is event driven. An operator springs into action when a pattern of data-readiness on it's inputs occurs. It them computes and outputs results on it's output channels. We like dataflow. =20 --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Aug 19 2013
On Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesTo my understanding "Message Passing Concurrency" in D is already very actor-like: void main() { Tid worker = spawn(&workerFunc, thisTid); worker.send(1); } void workerFunc(Tid owner) { int value = 0; value = receiveOnly!int(); writeln("value from parent: ", value); } Sample code above taken from the book by Ali Çehreli and then simplified. This is such a breeze compared to spawning a thread in C++ or Java. Question is what happens when you spawn some thousand actors. I don't know whether the threads in D are made for this. -- Bienlein
Nov 05 2013
On 11/05/2013 04:28 AM, Bienlein wrote:Tid worker = spawn(&workerFunc, thisTid);Going totally off topic here, there is ownerTid in every worker's context. (I suspect it was a relatively recent addition.) So, there is no need to pass the owner's tid explicitly: Tid worker = spawn(&workerFunc); Then the worker uses the available ownerTid: ownerTid.send(2); I will simplify those examples. Ali
Nov 05 2013
On 11/05/2013 07:20 AM, Ali Çehreli wrote:On 11/05/2013 04:28 AM, Bienlein wrote: > Tid worker = spawn(&workerFunc, thisTid); Going totally off topic here, there is ownerTid in every worker's context. (I suspect it was a relatively recent addition.) So, there is no need to pass the owner's tid explicitly: Tid worker = spawn(&workerFunc); Then the worker uses the available ownerTid: ownerTid.send(2); I will simplify those examples.Done: http://ddili.org/ders/d.en/concurrency.html Ali
Nov 07 2013
On Nov 5, 2013, at 4:28 AM, "Bienlein" <jeti789 web.de> wrote:=20he Actor model, as the relevant Wikipedia page says it does? [1]On Monday, 19 August 2013 at 03:11:00 UTC, Lu=C3=ADs Marques wrote: Can anyone please explain me what it means for the D language to follow t=uages=20 [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_lang==20 To my understanding "Message Passing Concurrency" in D is already very actor-like: =20 void main() { Tid worker =3D spawn(&workerFunc, thisTid); worker.send(1); } =20 void workerFunc(Tid owner) { int value =3D 0; value =3D receiveOnly!int(); writeln("value from parent: ", value); } =20 Sample code above taken from the book by Ali =C3=87ehreli and then simplified. This is such a breeze compared to spawning a thread in C++ or Java. Question is what happens when you spawn some thousand actors. I don't know whether the threads in D are made for this.Threads in std.concurrency are currently all kernel threads. However, just y= esterday I started working on a way to make that configurable by way of a us= er-defined Multiplexer class. The inspiration was to make it so message pass= ing works with vibe.d so different logical threads could communicate. It see= ms like a pretty simple change so far, though I guess we'll see today. As a d= emo, I'm creating both a ThreadMultiplexer and a FiberMultiplexer.=20=
Nov 05 2013
It seems like a pretty simple change so far, though I guess we'll see today. As >a demo, I'm creating both a ThreadMultiplexer and a FiberMultiplexer.That would be awesome. Something similar to lightweight threads as in Go or Rust and I'm all happy with D ;-).
Nov 08 2013
On Friday, 8 November 2013 at 08:22:56 UTC, Bienlein wrote:Has someone implemented this?It seems like a pretty simple change so far, though I guess we'll see today. As >a demo, I'm creating both a ThreadMultiplexer and a FiberMultiplexer.That would be awesome. Something similar to lightweight threads as in Go or Rust and I'm all happy with D ;-).
Nov 11 2017
Am 11.11.2017 um 13:28 schrieb Nordlöw:On Friday, 8 November 2013 at 08:22:56 UTC, Bienlein wrote:I have a PR open for vibe.d to add Go style channels: https://github.com/vibe-d/vibe-core/pull/25 It's just a quick draft so far and there are a few design questions in the comments at the top.Has someone implemented this?It seems like a pretty simple change so far, though I guess we'll see today. As >a demo, I'm creating both a ThreadMultiplexer and a FiberMultiplexer.That would be awesome. Something similar to lightweight threads as in Go or Rust and I'm all happy with D ;-).
Nov 11 2017
On Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesThe page is largely unverified, i.e. nobody cares that it is full of errors… D does not follow the actor model in any way shape or form…
Nov 11 2017
When I come to think of it, browser based Javascript might be considered to follow the Actor model at a high granularity using web-workers or even just http. But I think Hewitt's main idea was that it should be designed to be fault tolerant. The system of actors should continue to work well when an actor crashes and restarts. I think most «actor»-implementations fail at that. It is difficult to create an efficient «library solution» that makes the system fault tolerant.
Nov 11 2017
On Saturday, 11 November 2017 at 13:31:20 UTC, Ola Fosheim Grøstad wrote:On Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Wat? std.concurrency is message passing where an actor is either a Fiber or Thread.Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesThe page is largely unverified, i.e. nobody cares that it is full of errors… D does not follow the actor model in any way shape or form…
Nov 11 2017
On Saturday, 11 November 2017 at 18:30:33 UTC, Dmitry Olshansky wrote:On Saturday, 11 November 2017 at 13:31:20 UTC, Ola Fosheim Grøstad wrote:That's a library and it does not have much to do with actors, i.e. it does not ensure that every actor is an independent entity.On Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Wat? std.concurrency is message passing where an actor is either a Fiber or Thread.Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesThe page is largely unverified, i.e. nobody cares that it is full of errors… D does not follow the actor model in any way shape or form…
Nov 11 2017
On Saturday, 11 November 2017 at 20:37:59 UTC, Ola Fosheim Grostad wrote:On Saturday, 11 November 2017 at 18:30:33 UTC, Dmitry Olshansky wrote:So what? Should we say that c doesn’t support threads because they are implemented in the library.On Saturday, 11 November 2017 at 13:31:20 UTC, Ola Fosheim Grøstad wrote:That's a libraryOn Monday, 19 August 2013 at 03:11:00 UTC, Luís Marques wrote:Wat? std.concurrency is message passing where an actor is either a Fiber or Thread.Can anyone please explain me what it means for the D language to follow the Actor model, as the relevant Wikipedia page says it does? [1] [1] http://en.wikipedia.org/wiki/Actor_model#Later_Actor_programming_languagesThe page is largely unverified, i.e. nobody cares that it is full of errors… D does not follow the actor model in any way shape or form…and it does not have much to do with actors, i.e. it does not ensure that every actor is an independent entity.What’s not independent about thread? How it doesn’t ensure that? To me std.concurrency is pretty much Erlang-style message passing, except for supervision trees.
Nov 11 2017
On Saturday, 11 November 2017 at 21:47:53 UTC, Dmitry Olshansky wrote:On Saturday, 11 November 2017 at 20:37:59 UTC, Ola FosheimRegular C is not a concurrent language. D is not an actor based language. Has nothing to do with library features.That's a librarySo what? Should we say that c doesn’t support threads because they are implemented in the library.What is independent about a thread? A process is independent (mostly). How can it ensure that?and it does not have much to do with actors, i.e. it does not ensure that every actor is an independent entity.What’s not independent about thread? How it doesn’t ensure that?
Nov 11 2017