You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Kevin Livingston <ke...@betalasermike.com> on 2001/04/27 23:07:55 UTC

cleanup etc.

Hello all,

I was able to further my quest in obtaining an implementation of Xerces-C for VxWorks (thanks to Johannes at CERN) I have downloaded CERN's port and things seem to be functioning fairly well.  Thanks again Johannes.

Interestingly enough, as many programers new to Xerces have found out just like I have, multiple calls to Initialize() and Terminate() cause problems- now don't bash me just yet, or delete this, I think this is a new question (I looked in the archive - if it's there then you can bash me but I couldn't find it)

but anyway it appears as if due to the way things are implemented with Xerces once you call Terminate() you are done for that process as far as using Xerces goes, and  you won't be able to use it again. OK I understand that....

Now, on VxWorks the way the OS works is (and I'll do as good as I can here, I'm not a guru) that it is multi-threaded, however everything is in shared memory space. SO... basically that makes it work like one big process that has the life of the box, and when it is rebooted/reloaded the process is unloaded.  On Vx you load your code into memory and then just make the correct refrences.  For example the "prompt"/"shell" is really just like writing code where in when you write the line, that line is run at that moment.  So you make function calls etc. from the "shell" instead of "running" executables or programs
anyways, hopefully I explained that reasonably well...
So now the way I understand it is that I have no way to clean up Xerces and then later reuse it, without totally reloading/rebooting my board.  Because even in a new "program" if you will I am still in the same memory space / "process space" and thus susceptable to the Init/Terminate thing.

Hopefully that makes sense - I am notoriously good at knowing what I want to say but not being able to articulate it well.

Does any one have any thoughts on this?  Or what people on platforms like Vx should do in such a situation. (if I am not mistaken this might be close to the load/unload problem with DLL's in windows? again I am not a guru on that either.)

thanks again for all your input and help,
Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: cleanup etc.

Posted by Andy Heninger <an...@jtcsv.com>.
The key to being able to successfully call Initialize() on the Xerces
library is that all of the static data associated with the library must be
zeroed.  This will always be true when a conventional OS first loads a
library.  It is not true after terminate(), which is what prevents
Initialize from working a second time.

It sound like you have two alternatives here,

1.   Never call terminate on the xerces library.  It really isn't needed;
     its main purpose was to get clean up lazily allocated memory to
     avoid confusing leak detection tools, and to make life easier
     for developers who are trying to track down other leaks.  The
     amount of memory that is lazily allocated by xerces does not grow
     over time in any kind of unbounded way.

2.   If you do call terminate, make sure that static data area associated
     with the xerces library is zeroed out before reinitializing the
     library.

Andy Heninger
IBM, Cupertino, CA
heninger@us.ibm.com


----- Original Message -----
From: "Kevin Livingston" <ke...@betalasermike.com>
To: <xe...@xml.apache.org>
Sent: Friday, April 27, 2001 2:07 PM
Subject: cleanup etc.


> Hello all,
>
> I was able to further my quest in obtaining an implementation of
Xerces-C for VxWorks (thanks to Johannes at CERN) I have downloaded CERN's
port and things seem to be functioning fairly well.  Thanks again
Johannes.
>
> Interestingly enough, as many programers new to Xerces have found out
just like I have, multiple calls to Initialize() and Terminate() cause
problems- now don't bash me just yet, or delete this, I think this is a
new question (I looked in the archive - if it's there then you can bash me
but I couldn't find it)
>
> but anyway it appears as if due to the way things are implemented with
Xerces once you call Terminate() you are done for that process as far as
using Xerces goes, and  you won't be able to use it again. OK I understand
that....
>
> Now, on VxWorks the way the OS works is (and I'll do as good as I can
here, I'm not a guru) that it is multi-threaded, however everything is in
shared memory space. SO... basically that makes it work like one big
process that has the life of the box, and when it is rebooted/reloaded the
process is unloaded.  On Vx you load your code into memory and then just
make the correct refrences.  For example the "prompt"/"shell" is really
just like writing code where in when you write the line, that line is run
at that moment.  So you make function calls etc. from the "shell" instead
of "running" executables or programs
> anyways, hopefully I explained that reasonably well...
> So now the way I understand it is that I have no way to clean up Xerces
and then later reuse it, without totally reloading/rebooting my board.
Because even in a new "program" if you will I am still in the same memory
space / "process space" and thus susceptable to the Init/Terminate thing.
>
> Hopefully that makes sense - I am notoriously good at knowing what I
want to say but not being able to articulate it well.
>
> Does any one have any thoughts on this?  Or what people on platforms
like Vx should do in such a situation. (if I am not mistaken this might be
close to the load/unload problem with DLL's in windows? again I am not a
guru on that either.)
>
> thanks again for all your input and help,
> Kevin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org