Re: Tasks - communication

new topic     » goto parent     » topic index » view thread      » older message » newer message
eukat said...
jimcbrown said...
DerekParnell said...

I like the D Programming Language's approach to this, namely that all data is assumed to be shared between tasks unless explicitly said otherwise.

Seconded.


Global broadcasts between tasks ate more cpu clocks than narrowcasting. It increased the msg queue for each task, and the overhead in tracking which msgs got delivered and could be deleted to free memory. Memory use sounds trivial until you consider the size of msgs that could have been sent from http.e, for instance.

Agreed. The shared data should be global, rather than duplicated via messaging. It's faster for two threads to use the same block of memory than to have two processes communicate via IPC to notify each other of updates everytime one of the processes touches the object.

Perhaps I'm simply not thinking far enough ahead though - one day we may very well attempt to run multiple threads across different computers (and perhaps different architectures) on a cloud, for example.

eukat said...



So i provided for broad- and narrow- casting. You choose your best option for the app you are currently coding. Sue me.

I suspect that I'd normally choose narrowcasting most of the time, if I had to choose between those two options.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu