[prev in list] [next in list] [prev in thread] [next in thread]
List: mico-announce
Subject: Re: [mico-devel] calling _non_existent to a non existing Object
From: Wolfgang Schneider <wolfgang.schneider () schoenhofer ! de>
Date: 2005-04-11 7:30:47
Message-ID: 425A27A7.1030908 () schoenhofer ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Sorry Karel,
I was to much in a hurry!!!
> Wolfgang,
>
> first of all if you expect some help comming from MICO community, then you
> should provide more accurate and as much as possible information. So far
> you have just told us, that you have some issue with non_existent calls on
> Windows 2000/MICO 2.3.11 platform. What's missing here is:
>
0) Windows 2000/XP(diverse ServicePacks) have all the same problem with
our _non_existent() usage
>
> 1) compiler which you have used to compile MICO
>
Microsoft Visual Studio 2003, Version 7.1.3088
> 2) some details about MICO configuration (threading/security/etc)
>
- Multithreading, pthreads from 2002-09-20, compiler switches : .../D
"__CLEANUP_CXX" /D "HAVE_CONFIG_H"...
(I found another post mentioning problems with that library! Could it
be that Pthreads-win will cause my problems??? Should I look for a more
actual version?)
- no security
> 3) as simple as possible test-case which duplicate your issue, the best is
> something which is directly compilable on Win32/Unix so everybody can try
> to duplicate it.
>
The source code extract is (Sorry, but it would not be directly
compilable!):
// Our _non_existent() implementation with timeout option
...
#include "Zugriffssperre.h" // our RWLock-Implementation
#include "Objekt.h" // our smart pointer implementation
class ObjektExistiertInfo {
public:
CORBA::Object_ptr obj;
bool existiert; // existent
bool unterprozessIstAktiv; // subprocess is busy
bool unterprozessIstFertig; // subprocess is ready
Zugriffssperre sperre; // mutex
ObjektExistiertInfo(const CORBA::Object_ptr inObj)
:obj(inObj)
,existiert(false)
,unterprozessIstAktiv(false)
,unterprozessIstFertig(false)
{
}
};
// main thread code:
bool TStaticOrbBase::ObjektExistiert(const CORBA::Object_ptr obj, const
DauerWert & dauer ) // dauer = timeout
{
bool ret;
Objekt<ObjektExistiertInfo> info;
// Info so anlegen, dass der Letzte das Licht ausmachen kann (wir
oder der Unterprozess!)
info.ObjektUebernehmen(new ObjektExistiertInfo(obj));
Betriebssystem::UnterprozessStarten(TStaticOrbBase::_ObjektExistiert,&info);
// start subprocess
long dt;
if ( dauer.IstGueltig() ) {
Log << "Dauer=" << dauer.GibWert().GibDauerInSekunden() << "sec";
dt = dauer.GibWert().GibDauerInMillisekunden();
// timeout in msec
}
else {
Log << "Dauer = unendlich";
// infinit timeout
dt = -1;
}
// Unterprozess starten lassen:
Betriebssystem::Warten(0); //
wait for subprocess start
// Warten, dass Unterprozess startet
while ( dt && ! info->unterprozessIstAktiv) { // while sub
not busy
Log << "! info->unterprozessIstAktiv";
Betriebssystem::WartenInMsec(100);
dt -= 100;
}
DauerWert restdauer;
if ( dt >= 0 ) { // examin remaining timeout
restdauer = dauer.GibWert() + Dauer::Millisekunden(dt -
dauer.GibWert().GibDauerInMillisekunden());
}
// Warten, dass Unterprozess fertig ist // wait for
subprocess to finish
{
Lesezugriffssperre lesezugriff(info->sperre,false); // Read lock
lesezugriff.Sperren(restdauer);
// Lock with timeout (default 10 sec)
if ( info->unterprozessIstFertig ) {
// if subprocess succeed
ret = info->existiert;
// ret from Info struct
}
else {
ret = false; // no
success (timeout)
}
}
Log << "ret = " << ret;
return ret;
}
// sub thread code (calling _non_existent function):
unsigned TStaticOrbBase::_ObjektExistiert(void * objektExistiertInfo)
{
Objekt<ObjektExistiertInfo> * in = static_cast<
Objekt<ObjektExistiertInfo>* >(objektExistiertInfo);
if (in ) {
Objekt<ObjektExistiertInfo> info(*in) ; //
smart copy of info struct
Schreibzugriffssperre schreibzugriff(info->sperre); //
write lock
info->unterprozessIstAktiv=true;
// we are busy now
if ( !CORBA::is_nil( info->obj ) ) {
info->existiert = !info->obj->_non_existent(); // call
_non_existent ( this call will block all threads approx 15 sec, if obj
does not exist)
}
info->unterprozessIstFertig = true; //
we are ready (success!)
}
return 0;
}
>
> BTW: We're using non_existent call quite heavily in OpenPMF
> (http://www.openpmf.org) but have never seen such issue.
>
> Cheers,
> Karel
> --
> Karel Gardas kgardas@objectsecurity.com
> ObjectSecurity Ltd. http://www.objectsecurity.com
> ---
> Need experienced, fast, reliable technical MICO support?
> ---> www.objectsecurity.com/commsup.html <---
> ---
>
> On Fri, 8 Apr 2005, Wolfgang Schneider wrote:
>
>
>
> > Hello mico friends,
> >
> > we found that calling _non_existent () will obstruct the processing of
> > parallel _non_existent() calls (to other objects). (AutoLock!?)
> > If the object is non existent this will block the other threads 15 seconds.
> >
> > The problem occurs on initialization of our Federated NameService, which
> > has to connect to approx. 40 NameServices.
> > A serial processing of the _non_existent calls will end up in
> > initialization time greater than 10 Minutes on the systems started
> > first, which is hardly acceptable.
> >
> > But maybe this will be our last chance, if there is no way to enable a
> > non blocking parallel _non_existent option!!!
> >
> > Is there anybody out there, who has a solution to that problem.
> > Any suggestion is welcome
> >
> > We are using MICO 2.3.11 on Windows 2000.
> >
> > sincerely
> >
> > Wolfgang Schneider
> >
> > --
> > _______________________________________
> >
> > SCH?NHOFER SALES AND ENGINEERING GMBH
> > Lindenstra?e 92-98
> > 53721 Siegburg
> > Tel +49 (2241) 3099-33
> > Fax +49 (2241) 3099-10
> > wolfgang.schneider@schoenhofer.de
> > www.schoenhofer.de
> >
> > -----------------------------------------------------------------------------------------------------------------------------------------------------------
> >
> > This email is confidential and intended solely for the use of the
> > individual to whom it is addressed. Any views or opinions presented are solely \
> > those of the author and do not necessarily represent those of Sch?nhofer Sales \
> > and Engineering GmbH. If you are not the intended recipient, be advised that you \
> > have received this email in error and that any use, dissemination, forwarding, \
> > printing or copying of this email is strictly prohibited. If you have
> > received this email in error please notify Sch?nhofer Sales and
> > Engineering GmbH.
> >
> >
> >
>
>
>
>
>
--
_______________________________________
SCHÖNHOFER SALES AND ENGINEERING GMBH
Lindenstraße 92-98
53721 Siegburg
Tel +49 (2241) 3099-33
Fax +49 (2241) 3099-10
wolfgang.schneider@schoenhofer.de
www.schoenhofer.de
-----------------------------------------------------------------------------------------------------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are solely those \
of the author and do not necessarily represent those of Schönhofer Sales and \
Engineering GmbH. If you are not the intended recipient, be advised that you have \
received this email in error and that any use, dissemination, forwarding, printing or \
copying of this email is strictly prohibited. If you have
received this email in error please notify Schönhofer Sales and
Engineering GmbH.
[Attachment #5 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=X-UNKNOWN">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Sorry Karel,<br>
<br>
I was to much in a hurry!!!<br>
<br>
<br>
<blockquote type="cite"
cite="midPine.LNX.4.43.0504081110490.833-100000@thinkpad.gardas.net">
<pre wrap="">Wolfgang,
first of all if you expect some help comming from MICO community, then you
should provide more accurate and as much as possible information. So far
you have just told us, that you have some issue with non_existent calls on
Windows 2000/MICO 2.3.11 platform. What's missing here is:</pre>
</blockquote>
0) Windows 2000/XP(diverse ServicePacks) have all the same problem with
our _non_existent() usage<br>
<blockquote type="cite"
cite="midPine.LNX.4.43.0504081110490.833-100000@thinkpad.gardas.net">
<pre wrap="">
1) compiler which you have used to compile MICO</pre>
</blockquote>
Microsoft Visual Studio 2003, Version 7.1.3088<br>
<blockquote type="cite"
cite="midPine.LNX.4.43.0504081110490.833-100000@thinkpad.gardas.net">
<pre wrap="">
2) some details about MICO configuration (threading/security/etc)</pre>
</blockquote>
- Multithreading, pthreads from 2002-09-20, compiler switches : .../D
"__CLEANUP_CXX" /D "HAVE_CONFIG_H"...<br>
(I found another post mentioning problems with that library! Could it
be that Pthreads-win will cause my problems??? Should I look for a more
actual version?)<br>
<br>
- no security<br>
<blockquote type="cite"
cite="midPine.LNX.4.43.0504081110490.833-100000@thinkpad.gardas.net">
<pre wrap="">
3) as simple as possible test-case which duplicate your issue, the best is
something which is directly compilable on Win32/Unix so everybody can try
to duplicate it.</pre>
</blockquote>
<br>
The source code extract is (Sorry, but it would not be directly
compilable!):<br>
<br>
// Our _non_existent() implementation with timeout option <br>
<br>
...<br>
#include "Zugriffssperre.h" // our RWLock-Implementation<br>
#include "Objekt.h" \
// our smart pointer implementation<br> <br>
class ObjektExistiertInfo {<br>
public:<br>
CORBA::Object_ptr obj;<br>
bool existiert; \
// existent<br> \
bool unterprozessIstAktiv; // subprocess \
is busy<br> bool \
unterprozessIstFertig; // subprocess is ready<br> \
Zugriffssperre sperre; \
// mutex<br> ObjektExistiertInfo(const \
CORBA::Object_ptr inObj)<br> :obj(inObj)<br>
,existiert(false)<br>
,unterprozessIstAktiv(false)<br>
,unterprozessIstFertig(false)<br>
{<br>
}<br>
};<br>
<br>
// main thread code:<br>
bool TStaticOrbBase::ObjektExistiert(const CORBA::Object_ptr obj, const
DauerWert & dauer ) // dauer = timeout<br>
{<br>
bool ret;<br>
Objekt<ObjektExistiertInfo> info;<br>
<br>
// Info so anlegen, dass der Letzte das Licht ausmachen kann (wir
oder der Unterprozess!)<br>
info.ObjektUebernehmen(new ObjektExistiertInfo(obj));<br>
<br>
Betriebssystem::UnterprozessStarten(TStaticOrbBase::_ObjektExistiert,&info);
// start subprocess<br>
long dt;<br>
if ( dauer.IstGueltig() ) {<br>
Log << "Dauer=" <<
dauer.GibWert().GibDauerInSekunden() << "sec";<br>
dt = \
dauer.GibWert().GibDauerInMillisekunden(); \
\
// \
timeout in msec<br> }<br>
else {<br>
Log << "Dauer = unendlich"; \
\
\
\
\
// infinit timeout<br> dt = -1;<br>
}<br>
<br>
// Unterprozess starten lassen:<br>
Betriebssystem::Warten(0); \
\
// wait for subprocess start<br>
<br>
// Warten, dass Unterprozess startet<br>
while ( dt && ! info->unterprozessIstAktiv) \
{ // while sub not busy<br>
Log << "! \
info->unterprozessIstAktiv";<br> \
Betriebssystem::WartenInMsec(100);<br> dt -= \
100;<br> }<br>
<br>
DauerWert restdauer;<br>
if ( dt >= 0 ) { \
// examin remaining timeout <br>
restdauer = dauer.GibWert() + \
Dauer::Millisekunden(dt - dauer.GibWert().GibDauerInMillisekunden());<br>
}<br>
<br>
// Warten, dass Unterprozess fertig ist \
// wait for subprocess to finish<br>
{<br>
Lesezugriffssperre \
lesezugriff(info->sperre,false); // Read lock <br>
lesezugriff.Sperren(restdauer); \
\
// Lock with timeout (default 10 \
sec)<br> if ( info->unterprozessIstFertig ) \
{ \
// if subprocess succeed<br>
ret = \
info->existiert; \
\
// ret from Info struct<br> \
}<br> else {<br>
ret = false; \
\
// no \
success (timeout)<br> }<br>
}<br>
<br>
Log << "ret = " << ret;<br>
return ret;<br>
<br>
}<br>
// sub thread code (calling _non_existent function):<br>
unsigned TStaticOrbBase::_ObjektExistiert(void * objektExistiertInfo)
<br>
{<br>
Objekt<ObjektExistiertInfo> * in = static_cast<
Objekt<ObjektExistiertInfo>* >(objektExistiertInfo);<br>
<br>
if (in ) {<br>
Objekt<ObjektExistiertInfo> info(*in) \
; \
// smart copy of info struct<br> \
Schreibzugriffssperre schreibzugriff(info->sperre); // \
write lock<br> \
info->unterprozessIstAktiv=true; \
\
// we are busy now<br> <br>
if ( !CORBA::is_nil( info->obj ) ) {<br>
<br>
info->existiert = \
!info->obj->_non_existent(); // call \
_non_existent ( this call will block all threads approx 15 sec, if obj
does not exist)<br>
<br>
}<br>
info->unterprozessIstFertig = \
true; \
// we are ready (success!)<br>
}<br>
<br>
return 0;<br>
}<br>
<br>
<br>
<blockquote type="cite"
cite="midPine.LNX.4.43.0504081110490.833-100000@thinkpad.gardas.net">
<pre wrap="">
BTW: We're using non_existent call quite heavily in OpenPMF
(<a class="moz-txt-link-freetext" \
href="http://www.openpmf.org">http://www.openpmf.org</a>) but have never seen such \
issue.
Cheers,
Karel
--
Karel Gardas <a class="moz-txt-link-abbreviated" \
href="mailto:kgardas@objectsecurity.com">kgardas@objectsecurity.com</a> \
ObjectSecurity Ltd. <a class="moz-txt-link-freetext" \
href="http://www.objectsecurity.com">http://www.objectsecurity.com</a>
---
Need experienced, fast, reliable technical MICO support?
---> <a class="moz-txt-link-abbreviated" \
href="http://www.objectsecurity.com/commsup.html">www.objectsecurity.com/commsup.html</a> \
<---
---
On Fri, 8 Apr 2005, Wolfgang Schneider wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello mico friends,
we found that calling _non_existent () will obstruct the processing of
parallel _non_existent() calls (to other objects). (AutoLock!?)
If the object is non existent this will block the other threads 15 seconds.
The problem occurs on initialization of our Federated NameService, which
has to connect to approx. 40 NameServices.
A serial processing of the _non_existent calls will end up in
initialization time greater than 10 Minutes on the systems started
first, which is hardly acceptable.
But maybe this will be our last chance, if there is no way to enable a
non blocking parallel _non_existent option!!!
Is there anybody out there, who has a solution to that problem.
Any suggestion is welcome
We are using MICO 2.3.11 on Windows 2000.
sincerely
Wolfgang Schneider
--
_______________________________________
SCH?NHOFER SALES AND ENGINEERING GMBH
Lindenstra?e 92-98
53721 Siegburg
Tel +49 (2241) 3099-33
Fax +49 (2241) 3099-10
<a class="moz-txt-link-abbreviated" \
href="mailto:wolfgang.schneider@schoenhofer.de">wolfgang.schneider@schoenhofer.de</a> \
<a class="moz-txt-link-abbreviated" \
href="http://www.schoenhofer.de">www.schoenhofer.de</a>
-----------------------------------------------------------------------------------------------------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are solely those \
of the author and do not necessarily represent those of Sch?nhofer Sales and \
Engineering GmbH. If you are not the intended recipient, be advised that you have \
received this email in error and that any use, dissemination, forwarding, printing or \
copying of this email is strictly prohibited. If you have
received this email in error please notify Sch?nhofer Sales and
Engineering GmbH.
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
_______________________________________
SCHÖNHOFER SALES AND ENGINEERING GMBH
Lindenstraße 92-98
53721 Siegburg
Tel +49 (2241) 3099-33
Fax +49 (2241) 3099-10
<a class="moz-txt-link-abbreviated" \
href="mailto:wolfgang.schneider@schoenhofer.de">wolfgang.schneider@schoenhofer.de</a> \
<a class="moz-txt-link-abbreviated" \
href="http://www.schoenhofer.de">www.schoenhofer.de</a>
-----------------------------------------------------------------------------------------------------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are solely those \
of the author and do not necessarily represent those of Schönhofer Sales and \
Engineering GmbH. If you are not the intended recipient, be advised that you have \
received this email in error and that any use, dissemination, forwarding, printing or \
copying of this email is strictly prohibited. If you have
received this email in error please notify Schönhofer Sales and
Engineering GmbH. </pre>
</body>
</html>
_______________________________________________
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic