lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

The one "issue" I could see with your approach is that reading the signal
tested in the line hook actually depends on memory synchronization and doing
that properly is almost as expensive as a mutex lock/unlock. Is this not an
issue because you potentially just churn through enough memory that
eventually the value gets propagated?

The approach I've implemented simply has the line hook code test a (zero/non-zero) flag variable.

At first I wanted to use a more atomic set/test mechanism, but to make a long story short: the flag variable just worked. So I kept it there [:-)]. It's been in production code for about 2 years now and we haven't had any problems with it.

As far as performance is concerned, I did quite a bit of benchmarking at the time. Running under the linehook does slow things down a bit, but to be honest I've forgotten the actual numbers. And because everything performed more than satisfactorily, I haven't look at it since.

Of course, if ever speed does become an issue, you simply have the controller thread do most of the processing. You still keep the parallel processing and the messaging (between boxes).

no signature is a signature.