[omniORB] omniAsyncInvoker destructor
sheena kansal
sheena.kansal at gmail.com
Mon Dec 30 19:46:13 GMT 2013
Hi,
I have a doubt in the trace lines 340 and 342 below -
omniAsyncInvoker
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniAsyncInvoker>::~omniAsyncInvoker
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=%7EomniAsyncInvoker>()
{307 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L307>
308 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L308>
pd_lock->lock
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=lock>();309
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L309>
pd_keep_working = 0;310
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L310>
while (pd_idle_threads) {311
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L311>
omniAsyncWorker
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniAsyncWorker>*
t <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t> =
pd_idle_threads;312
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L312>
pd_idle_threads = t
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t>->pd_next;313
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L313>
t <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t>->pd_next
= 0;314 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L314>
t <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t>->pd_in_idle_queue
= 0;315 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L315>
t <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t>->pd_cond->signal
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=signal>();316
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L316>
}317 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L317>
318 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L318>
*// Wait for threads to exit*319
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L319>
if (pd_totalthreads) {320
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L320>
unsigned long timeout
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout>, s
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=s>, ns
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=ns>;321
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L321>
if (orbParameters::scanGranularity
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=scanGranularity>)322
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L322>
timeout <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout>
= orbParameters::scanGranularity
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=scanGranularity>;323
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L323>
else324 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L324>
timeout <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout>
= 5;325 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L325>
326 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L326>
omni_thread
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omni_thread>::get_time
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=get_time>(&s
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=s>, &ns
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=ns>, timeout
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout>);327
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L327>
328 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L328>
if (omniORB
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB>::trace
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=trace>(25)) {329
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L329>
omniORB <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB>::logger
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=logger> l
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l>;330
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L330>
l <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l> <<
*"Wait for "* << pd_totalthreads << *" invoker thread"*331
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L331>
<< plural
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=plural>(pd_totalthreads)
<< *" to finish.\n"*;332
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L332>
}333 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L333>
int go = 1;334
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L334>
while (go && pd_totalthreads) {335
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L335>
go = pd_cond->timedwait
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timedwait>(s
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=s>, ns
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=ns>);336
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L336>
}337 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L337>
if (omniORB
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB>::trace
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=trace>(25)) {338
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L338>
omniORB <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB>::logger
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=logger> l
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l>;339
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L339>
if (go)340
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L340>
l <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l> <<
*"Invoker threads finished.\n"*;341
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L341>
else342 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L342>
l <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l> <<
*"Timed out. "* << pd_totalthreads343
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L343>
<< *" invoker threads remaining.\n"*;344
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L344>
}345 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L345>
}346 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L346>
pd_lock->unlock
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=unlock>();347
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L347>
348 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L348>
delete <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=delete>
pd_cond;349 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L349>
delete <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=delete>
pd_lock;350 <http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L350>
omniORB <http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB>::logs
<http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=logs>(10,
*"AsyncInvoker: deleted."*);351
<http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L351>
}
Here, the timedwait() will return either 0, 1 or -1. i.e. It returns 0 if
successfully signaled, 1 if time expired and -1 in case of error.
now, as per the trace code above, if the "go" parameter is true i.e. 1 it
will print "Invoker thread finished", though 1 means time expired.
and else part will be executed if "go" is 0 or -1 i.e. both success or
failure, we are saying trace - "Timed out",
Isn;t it should be other way round?
--
Regards,
Sheena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20131231/9acf3087/attachment.html>
More information about the omniORB-list
mailing list