Alaska Software Inc. - WAA threads
Username: Password:
AuthorTopic: WAA threads
Vladimir IahnencoWAA threads
on Mon, 30 Jan 2006 15:42:45 -0500
Hi All,
Is it possible to check if all waa threads are alive at the moment. I want 
to investigate if some waa slow down caused by network issues  or because of 
some waa threads got unavailable, i.e. got hung.
My understanding that I  have to parse WAA logs to check  thread start and 
end points.

Thanks in advance
Vladimir
Phil Ide
Re: WAA threads
on Tue, 31 Jan 2006 14:18:10 +0000
Vladimir,

> Hi All,
> Is it possible to check if all waa threads are alive at the moment. I want 
> to investigate if some waa slow down caused by network issues  or because of 
> some waa threads got unavailable, i.e. got hung.
> My understanding that I  have to parse WAA logs to check  thread start and 
> end points.

At this moment it is not possible to see which threads are running, unless
you want to dive into the internals.

Specifically, it is possible to get a reference to each worker thread and
you can query its active status (including delta time).  However, as you
rightly mentioned, peeking into the log will also tell you this.  You also
have to be careful, because if any of your packages have launched additional
threads, there is no way to tell them apart from the worker threads, unless
your own threads are derived from a user-defined class.

An easier way to test your hypothesis that WAA threads are hnging, is to get
each thread to write to it's own log.

Function MyFormFunc( oHtml, oContext )
   local blah, blah, blah

   ThreadedLog( 'Starting '+ProcName() )
   ...
   ThreadedLog( 'Ending '+ProcName() )
   RETURN TRUE

Function ThreadedLog( cText )
   local cFile := 'WTLOG_'+StrZero( ThreadId(), 3 )+'.LOG'
   local nH

   if FExists( cFile )
      if (nH := FOpen( cFile, FO_READWRITE )) <> 0
         FSeek( nH, 0, FS_END )
      endif
   else
      nH := FCreate( cFile )
   endif
   if nH <> 0
      cText := dtos(Date())+' '+Time()+'# '+cText+CRLF
      FWrite( nH, cText )
      FClose(nH)
   endif
   return NIL

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

I will not employ robots as agents of destruction if there is any possible
way that they can be re-programmed or if their battery packs are externally
mounted and easily removable.
          [Things I'd do as an Evil Overlord]
Vladimir IahnencoRe: WAA threads
on Tue, 31 Jan 2006 09:42:33 -0500
Thanks, Phil,
A good idea to create log files for each thread and this easily can be added 
to an existing procedure.

Thanks again,
Vladimir

"Phil Ide" <phil@idep.org.uk> wrote in message 
news:14citux2ij597.dlg@idep.org.uk...
> Vladimir,
>
>> Hi All,
>> Is it possible to check if all waa threads are alive at the moment. I 
>> want
>> to investigate if some waa slow down caused by network issues  or because 
>> of
>> some waa threads got unavailable, i.e. got hung.
>> My understanding that I  have to parse WAA logs to check  thread start 
>> and
>> end points.
>
> At this moment it is not possible to see which threads are running, unless
> you want to dive into the internals.
>
> Specifically, it is possible to get a reference to each worker thread and
> you can query its active status (including delta time).  However, as you
> rightly mentioned, peeking into the log will also tell you this.  You also
> have to be careful, because if any of your packages have launched 
> additional
> threads, there is no way to tell them apart from the worker threads, 
> unless
> your own threads are derived from a user-defined class.
>
> An easier way to test your hypothesis that WAA threads are hnging, is to 
> get
> each thread to write to it's own log.
>
> Function MyFormFunc( oHtml, oContext )
>   local blah, blah, blah
>
>   ThreadedLog( 'Starting '+ProcName() )
>   ...
>   ThreadedLog( 'Ending '+ProcName() )
>   RETURN TRUE
>
> Function ThreadedLog( cText )
>   local cFile := 'WTLOG_'+StrZero( ThreadId(), 3 )+'.LOG'
>   local nH
>
>   if FExists( cFile )
>      if (nH := FOpen( cFile, FO_READWRITE )) <> 0
>         FSeek( nH, 0, FS_END )
>      endif
>   else
>      nH := FCreate( cFile )
>   endif
>   if nH <> 0
>      cText := dtos(Date())+' '+Time()+'# '+cText+CRLF
>      FWrite( nH, cText )
>      FClose(nH)
>   endif
>   return NIL
>
> Regards,
> -- 
> Phil Ide
>
> ***************************************
> * Xbase++ FAQ, Libraries and Sources: *
> * goto: http://www.idep.org.uk/xbase  *
> ***************************************
>
> I will not employ robots as agents of destruction if there is any possible
> way that they can be re-programmed or if their battery packs are 
> externally
> mounted and easily removable.
>          [Things I'd do as an Evil Overlord]