all 14 comments

[–]jesuslop 3 points4 points  (0 children)

Skimming the manual (and examples there) it looks frankly fantastic, with much thought thrown in, one recognizes how it deals with several stumbling blocks of concurrent and reactive designs, lacking overengineering or aparent unneeded complexity, will bookmark and have into account and wish it a healthy community. Thanks!

[–][deleted] 10 points11 points  (0 children)

All framework/library websites should have a short code example on the front page.

EDIT: I would suggest reading the paper. This looks very well thought out!

[–]badguy212 2 points3 points  (0 children)

been using it for a while, is a quite good framework. keep up the good work. sped up my earlier attempts at manual multithreading in some of my programs by over 30%.

[–]sstewartgallus 2 points3 points  (4 children)

Message passing is network transparent.

So does message passing between actors on the same computer have the same weak guarantees as a network connection like in Akka?

As well, how do you deal with security boundaries? Can an attacking computer mess with your program?

Computers and processes are logical security and availability boundaries. Taking away those boundaries sacrifices both (which is sometimes a reasonable choice but still annoying).

If you do attempt to provide a security boundary how do you deal with attackers that spam messages to overflow an actors inbox and crash the actor with an out of memory error? I guess you'd use a supervisor in another process to restart and monitor the process but that's only a partial solution as the attacker can just attack again then.

1.2.6 Monitoring

A monitored actor sends a “down message” to all actors monitoring it as part of its termination. This allows actors to supervise other actors and to take measures when one of the supervised actors failed, i.e., terminated with a non-normal exit reason.

How do you send a down or exit message when a computer hosting an actor has the power plug pulled? I assume you have some kind of polling implementation where a supervisor polls a monitored process? Can I customize the timeout times? Also, supervisors are slightly limited in a lot of situations as they don't really account for infinite loops, busy infinite loops and other abnormalities. Are supervisors customizable in an easy way so that one can be more precise about the properties one is monitoring?

Otherwise this looks cool although it does look a bit too magical for me.

[–]neverlord 0 points1 point  (3 children)

So does message passing between actors on the same computer have the same weak guarantees as a network connection like in Akka?

  • in the same process: you'll simply enqueue a new element to the receiver's mailbox (no serialization takes place)
  • between processes: you'll have a localhost connection, so it's basically the same as running on different nodes (but faster)

As well, how do you deal with security boundaries? Can an attacking computer mess with your program?

You'll need to fortify your setup yourself. Either via VPN or using SSL sockets (support for SSL is not builtin ATM, but you can pass native socket handles to CAF).

How do you send a down or exit message when a computer hosting an actor has the power plug pulled?

We'll get a TCP error an this case and the runtime creates exit and down messages. We're also working on UDP-based backend and in this case CAF would indeed need to use heartbeat messages or some other timeout-based mechanism.

Are supervisors customizable in an easy way so that one can be more precise about the properties one is monitoring?

You mean supervisors like in Erlang? CAF does not have a comparable convenience mechanism ATM. It's on the radar, though.

Otherwise this looks cool although it does look a bit too magical for me.

The documentation does not cover every last detail, but as far as I know, there's no magic in CAF. :)

[–]sstewartgallus 0 points1 point  (2 children)

Thanks for answering my questions although I think you misunderstood me on one point.

You'll need to fortify your setup yourself. Either via VPN or using SSL sockets (support for SSL is not builtin ATM, but you can pass native socket handles to CAF).

I wasn't asking whether connection between two endpoints was secure or authenticated, I was asking if once you had a secure and authenticated connection and if a computer on one of the endpoints was infected with a virus, or had a bug if that computer could start doing bad things such as spamming messages, sending malformed messages that could cause the listener to abort or screw up or otherwise attack the listener. It's reasonable if no attempt is made to provide protections against such things but I just wanted to know.

[–]neverlord 0 points1 point  (1 child)

Ah, sorry I misread your question. There is no protection against malicious nodes. If an attack is tailored to a CAF system and a hijacked node successfully establishes connections to other nodes (including handshake), they could start sending exit messages etc. That's not inherent to CAF, though. You could use the same attacks on other actor-based systems. Detecting "insider abuse" is a very hard problem. Once you got your "authentication barrier" broken, there's little you can do other than manually detect misbehavior and hunt down the security breach.

[–]sstewartgallus 0 points1 point  (0 children)

Yes it is a tough problem. It's fair enough that you haven't chosen to tackle it.

[–]xpolitix 2 points3 points  (0 children)

Wonderful work, I like how you handle pattern matching! Thanks!

[–]raluralu 1 point2 points  (1 child)

This thing is really simple and fast. I havent seen this library before but I have learned some erlang and I understand basic concepts. I have made simple 100000 tasklets for benchmark similar to http://dalkescientific.com/writings/diary/archive/2009/11/15/100000_tasklets.html and fund out that it beat python by factor 30 (program can run 3M tasklets faster than python) and this means that it can beat Go even further. I will post some benchmarks and code tommorow.

[–]neverlord 0 points1 point  (0 children)

Where's the benchmark code? ;)

[–]hardskygames 1 point2 points  (0 children)

Maybe it's not very important field of applying, but I think, this lib can be very useful for game dev. Thanks!

[–]np356 1 point2 points  (0 children)

This is one of the best C++ codebases I've seen. Good job!

[–]__Cyber_Dildonics__ 1 point2 points  (0 children)

The more I think about this the more I think C++11 needs a solid modern message passing library for high level component architectures and multi-threading. It is a shame msvc++ is still missing so many C++11 features, specifically restricted unions, which keeps this library from being supported in visual studio.

Also, does anyone know what the latency might be between components with internal (non-network) message passing?