ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
18 Seconds (Sdk)
18 Seconds // SdkgrimbleJun 21, 2006, 1:53pm
I don't *think* this is my code ... so I'll ask the question, although it
may seem a bit cryptic. Does 18 seconds mean anything to anyone? Sometimes (I can't explain when exactly) aw_wait sits there doing nothing for almost exactly 18 seconds - always within a few of tenths of a second - after the handler for the last message has completed processing and it doesn't return back to my main bot loop. I put some extra console messages in to work out where it was stopping, and the problem went away. I take some of them back out, the problem returns! It can happen on synchronous or asynchronous calls and its DEFINITELY stuck in aw_wait (I've got markers either side of aw_wait now, so I KNOW its in pausing there). Any ideas/comments welcome. My initial assumption was that it was my code causing the lack of activity, but I'm certain that its not now (not directly anyway). Its probably worth saying that this has coincided with moving to build 61. I'll pop it back onto build 60 later and see if it makes any difference. Thanks, Grims dm mercuryJun 21, 2006, 5:42pm
Definantly odd. I havent tried build 61 just yet. Possibility it is being
caused by extraneous resources being used at the time of aw_wait. The 4.1 sdk did just get a gender change so to speak, so who knows what weird problems like this we might encounter over the enxt couple days. It could be a bug or memory leak. When the anything active worlds defies logic, check your system resources; that's my general rule. DM [View Quote] grimbleJun 22, 2006, 5:36am
Build 60 demonstrates the same problem.
The process is showing no activity while its paused and I can still get the problem after forcing garbage collection (its in .NET 2.0) after each event/callback. Maybe its an interop issue, but I can't trace it. I assume this isn't anything anyone's seen before. Perhaps its related to two other things ... (a) It takes 2 for aw_init to do its stuff (is this the unpacking?) - I thought this used to be almost instantaneous. (b) aw_enter times out about one in five times. Oh well ... Grims. [View Quote] grimbleJun 22, 2006, 7:17am
OK, so it WAS my fault, kinda, although its annoying.
I had a version of the framework that supported kicking off event handlers in their own background thread but I hit this exact problem then (the magic number is actually more like 20 seconds, which is how long the SDK seemed to wait when it hit a conflict) and I had to impement resource locking around use of the SDK to stop it. In the interests of keeping it simple, I took all the tread support (and therefore the locking) out of the code, but this now means that I can't have a background aw_wait loop thread for the same reasons. I guess I'm looking at either not having the aw_wait loop in the framework or implementing user exits in the loop for the bot application to do the things it needs to (like log in) with the loop running. Anyway, pointless thread sorry, Grims [View Quote] |