call return spaghetti

36 views
Skip to first unread message

Paul Tarvydas

unread,
Jul 6, 2021, 3:37:22 PM7/6/21
to Flow Based Programming
an older blog post that has relevance to what I just posted


pt

Niclas Hedhman

unread,
Jul 7, 2021, 3:57:44 AM7/7/21
to flow-based-...@googlegroups.com

Very interesting post.

I am making an FBP-like system using the Pony Language, because
  a. It has an actor model built-in, i.e. input queue on components. Placing an event on the input queue, however, is basically the same as a function call, except in Pony the callee declares a "Behavior" rather than a "Function" which completely changes the call semantics (from function call to queueing an event and becoming asynchronous).

  b. Blocking-free. Each actor (i.e. input queue) is assigned to a OS thread, to minimize cache sync. One thread per CPU Core, to minimize context switching.

  c. Data-race guarantees, either shared or mutable but not both. Mutable data can be passed between components/actors, yet language guarantees that read/write can not get corrupted.

Basically all the "Requirements" are filled at the language level (except "lock routing wire"), and what I have done is to allow the creation of pluggable components according to my domain's needs (not IT related, so 'events' are actually numeric values). I am not sure what "lock routing wire" means.

Cheers
Niclas



--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flow-based-programming/c9e6421f-d23e-412c-8c01-b997512fbcccn%40googlegroups.com.

Paul Tarvydas

unread,
Jul 8, 2021, 12:27:15 AM7/8/21
to Flow Based Programming
I keep meaning to learn about Pony, but I am loathe to dive into yet another wall of information and "how to program" bumph.  

Is there a "Pony for programmers" tutorial?

thanks
pt

Paul Tarvydas

unread,
Jul 8, 2021, 12:28:20 AM7/8/21
to Flow Based Programming
Caution: Actors are only the building-blocks of async programs.  Similar to the suggestions in "GOTO Considered Harmful", one needs to find ways to structure Actor-based system designs.  [aside: people avoid message-based systems because early message-based systems were flat and tangled - something that a good wallop of structuring could fix].

pt


On Wednesday, July 7, 2021 at 3:57:44 AM UTC-4 Niclas Hedhman wrote:

Paul Tarvydas

unread,
Jul 8, 2021, 12:37:32 AM7/8/21
to Flow Based Programming
re. locks:

One can dispense with operating systems completely, since their main function is to map async programming to sync programming (their secondary function is to act as a library of useful stuff - Components can be used instead (get rid of O/Ss, I say)).

In a truly async system, at the bare-metal level, you need to lock message-queuing if messages can go to more than one receiver (aka fan-out).  FBP disallows fan-out.  Fan-out can be implemented in FBP by using a component that makes copies of incoming messages.  Such components need to send all copies to all receivers "at the same time" (i.e. using a lock) to preserve timing.  It's been a looong time since I read JPM's book, but I suspect that the chapter(s) on deadlock is related to this issue.  Currently, I favour nesting (scoping) Components and not-letting Containers run until all of their Children are idle (which needs locking at the very low-levels of the engine).

Locking is moot when running on synchronous systems (e.g. operating systems ; using only one thread)

Asynchronous hardware interrupts make things much more interesting.

I wonder if Pony's locks have something to do with resource-tracking and deadlock elimination?  (I haven't read the documentation yet).

pt


On Wednesday, July 7, 2021 at 3:57:44 AM UTC-4 Niclas Hedhman wrote:
Reply all
Reply to author
Forward
0 new messages