Jump to content

[solved] llMessageLinked taking over 20 seconds to reach target script in same prim


You are about to reply to a thread that has been inactive for 3648 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have a very large script that was running out of memory so I broke it into two scripts, moving HTTP communication and data lists off to a child script.  The main script uses llMessageLinked to pass requests on to the child script, like so:

llMessageLinked(LINK_THIS, _COMMANDS, sMyRequest, gkOwner)
// where gkOwner is a global previously declared as llGetOwner()

I put an llOwnerSay in the main script when it first sends the request and in the child script at the start of link_message, and got these results back:

[07:44:23]  Prototype: main sending pickcontact over _COMMANDS
[07:44:45]  Prototype: child got command over _COMMANDS channel

I have reset the scripts, detached and reattached the object, tried LINK_SET instead of LINK_THIS, moved to different regions, left it overnight and restarted in the morning, and in every instance the lag ruins timing. It was actually worse with LINK_SET, over 70 seconds.

The only time either script sleeps is when the child script issues an llHTTPRequest, at which point it sleeps for 1.0 seconds to avoid exceeding the HTTP cap.  But in this case, no HTTP requests were posted; the child script was just sitting idle waiting for the link_message event to trigger.

Even weirder, it's *only* this one event.  Other link messages go through in under 1 second, exactly as they should.

Has anyone seen this before?  Any suggestions on how to fix it?  I have been scripting for six years, and have used llMessageLink thousands of times... never saw it delay like this before.

 

Link to comment
Share on other sites

The message transfer works instantly.
That of course only if you do not block it by using llSleep or other long taking functions / loops.

The events are NO interrupts! Events are only processed if the script is not busy or halted. (by llSleep for example)

Why you transfer the owner ID? Thats completely unnecessary. Both scripts already know that you are the owner so you transmit no info.

Link to comment
Share on other sites

It was a timing issue. To prevent exceeding the limit on llHTTPRequest I follow every HTTP request with llSleep of 0.9 seconds.  Since I split HTTP off into a child script, requests from the parent script were getting ignored while the child script was in llSleep.

I had to make the parent script smart enough to know not to keep sending requests until the child script was ready for them, and the child script smart enough to only do llSleep if it detected too many llHTTPRequest calls in too short a time.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3648 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...