10-23-2013, 06:33 AM
Yes, on its own it's not slow, but it causes lock convoys - each such call must lock an additional plugin's critical section. If the plugin is busy, with lots of hooks, this will become costly.
HOWTO: Inter-plugin communication
|
||||||
10-23-2013, 06:33 AM
Yes, on its own it's not slow, but it causes lock convoys - each such call must lock an additional plugin's critical section. If the plugin is busy, with lots of hooks, this will become costly.
11-25-2013, 12:29 AM
Is the cPlugin::Call function able to parse functions as parameter?
11-25-2013, 01:33 AM
No, it cannot, mainly because functions in Lua are really closures - they take with them the local values of their containing functions and are able to modify those; this cannot be safely ported to another Lua state structure. Consider the following example:
Thanks given by: NiLSPACE
11-25-2013, 04:44 AM
11-25-2013, 04:46 AM
I just realized that you can parse a function as a string and then use the loadstring() function to execute it. for example:
Hmm wait now i'm suddenly unsure if it works..
That might work but is pretty much useless. Such a function won't have the upvalues, so it won't see neither the first plugin's globals nor the locals. Consider this example:
I'm not sure now whether Plugin2 will fail on the actual execution, or if the loadstring() will already complain about the undefined function. But the end result is the same - the callback just cannot access Plugin1's data in any way.
12-07-2013, 06:56 AM
Yea I posted it and then suddenly I was like: "Wait... It's nog going to work isn't it..."
| ||||||
« Next Oldest | Next Newest »
|