A question about what makes a script "active" exactly.
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
10-26-2005 07:00
integer num = 0; default { link_message(integer src, integer num, string msg, key id) { if (( msg == "send_email" ) && ( num = me )) { list parse = llParseString2List((string)id, ["|||"], [""]); string addr = llList2String(parse, 0); string subj = llList2String(parse, 1); string body = llList2String(parse, 2); llEmail(addr, subj, message); } } } The above is listed as an "active" script, both in 1.6.x and now in 1.7 That makes no sense to me! Shouldnt' that just sit there like a lump until there's a message? It's active even when there are no other scripts in the prim, too.
|
|
Travis Bjornson
Registered User
Join date: 25 Sep 2005
Posts: 188
|
10-26-2005 07:10
I think it should be considered active because it is waiting for something to happen. It's not using any CPU time, but most scripts spend most of their lives in that state -- not doing anything at the moment, but waiting.
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
10-26-2005 07:12
From: Travis Bjornson I think it should be considered active because it is waiting for something to happen. It's not using any CPU time, but most scripts spend most of their lives in that state -- not doing anything at the moment, but waiting. Then any script with an event handler would be "active"... and that would be all of 'em!
|
|
Travis Bjornson
Registered User
Join date: 25 Sep 2005
Posts: 188
|
10-26-2005 07:22
True, except scripts that are disabled, which almost none of them are.
|
|
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
|
10-26-2005 07:37
From: Jillian Callahan The above is listed as an "active" script, both in 1.6.x and now in 1.7 That makes no sense to me! Shouldnt' that just sit there like a lump until there's a message? It's active even when there are no other scripts in the prim, too.
It's like a listen, as I understand it - it's still periodically "checking" for a message. (That said, I imagine the limited domain of a link message means that while it might count as active, some scripts are more active than others; I doubt it really adds much to the total script-processing time.) This is somewhat different from other event handlers like touch, which are by nature limited to specific and intended interaction; listens and link messages are potentially checking every link-message or chat broadcast near them - and even if you filter, the sim has to take a tiny bit of time to check the filter. At least, this is my intuitive guess, I may be totally wrong!
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?” Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
|
|
Travis Bjornson
Registered User
Join date: 25 Sep 2005
Posts: 188
|
10-26-2005 07:41
From: someone while it might count as active, some scripts are more active than others Right - I believe in most languages, a script that's waiting for a signal is using exactly zero CPU time, but the system knows under what circumstances to wake it up. It still counts as a running script because it could get woken up at any moment.
|
|
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
|
10-26-2005 07:53
From: Aliasi Stonebender It's like a listen, as I understand it - it's still periodically "checking" for a message. I would guess, rather, that linked messages are not polled like chat listens, but act the same as touch events. This post and this thread show that "active scripts" now simply counts all scripts - active AND inactive. I would guess that soon enough, LL will change the name of this stat. They have already indicated that a count of truly active scripts is not really representative of anything anyway - some active scripts are light and nimble, others are hulking beasts - and the count doesn't tell you which are which.
|
|
Persial Hebert
Crashlander
Join date: 28 Sep 2005
Posts: 33
|
10-26-2005 07:57
I would hope that loose scripts in "for sale" boxes are disabled, but I've run into "for sale" boxes that turn physical when you click on them, or otherwise misbehave. Maybe I'm too optimistic.
I think the "active scripts" count really needs to be considered as "scripts directly in object inventories", to distinguish them from scripts in inventory objects.
I would HOPE that a script that's just waiting on an event is using no CPU time Even listens on channel 0 shouldn't use up any CPU time when there's no agents nearby and talking.
OTOH... Scripts in attachments that listen and talk to their owner on channel 0, like x-flight, are just evil. That's true for vehicles too, to a lesser extent. I love my skitter but I wish it accepted "/1 start" instead of listening on 0.
OTGH... it shouldn't matter how many well-behaved scripts are on a sim or in an object. If they're all in wait and using the fewest and least frequent events (and using directed link messages rather than having multiple external event handlers in an object!) it doesn't hurt.
|
|
Persial Hebert
Crashlander
Join date: 28 Sep 2005
Posts: 33
|
Speaking of evil.
10-26-2005 08:00
Web forums that run javascript every time you hit a key are evil too.
|
|
Nathan Stewart
Registered User
Join date: 2 Feb 2005
Posts: 1,039
|
10-26-2005 08:02
As far as the statistics window goes all scripts that are active in the sim are counted, this now includes those in child prims and those on avatars. This can get confused from what people usually refer to what an "active" script is, (ie timer, listener etc)
|
|
Eata Kitty
Registered User
Join date: 21 Jan 2005
Posts: 387
|
10-26-2005 08:32
It shouldn't, as it's an event based system, waiting for events is passive. Any polling would make it active.
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
10-26-2005 15:07
From: Persial Hebert OTOH... Scripts in attachments that listen and talk to their owner on channel 0, like x-flight, are just evil. That's true for vehicles too, to a lesser extent. I love my skitter but I wish it accepted "/1 start" instead of listening on 0. You would not belive the hissy fits people threw at me when my old Mercury first came out, all commands on channel 1. So, I try and make a balance. All my latest vehicles now turn off thier listens if there's no one in the pilot's seat. Anyway, though I'm sure the above has minimal impact on a sim, the problem is people count it as acive, and don't want my vendors. (Passive only, they bark. Well, this is passive.  ) Thanks everyone for your input! 
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
10-26-2005 15:54
From: Jillian Callahan You would not belive the hissy fits people threw at me when my old Mercury first came out, all commands on channel 1. Don't they feel like a goon talking to inanimate objects?
|