[Tutor] Final de-allocation before the application exists
K Dhanvi
dhanvik@gmx.net
Tue Jul 22 07:26:02 2003
This is a multi-part message in MIME format.
------=_NextPart_000_0115_01C35072.6A148790
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sorry about my english in the previous mail.=20
I re-state my question in this mail :=20
I would like to know whether Python has a function which would be =
called just before the end of the application. I cannot use destructors =
in my application because I have some static data in my application that =
is modified during the life cycle of the application. If I have any =
function like this , then I could hide the gory details of de-allocation =
of resources completely from the user. This way, what he ( user ) does =
not know, he need not be bothered about :)..=20
( I am allocating the resources and threads in my module which is used =
by an application. I would like to de-allocate resources in the =
application )
well thats my query.. incase theres something I am missing in my =
approach please point me out .. thanks a lot for your time and help.
with regards,=20
K Dhanvi
----- Original Message -----=20
From: K Dhanvi=20
To: tutor@python.org=20
Sent: Tuesday, July 22, 2003 4:30 PM
Subject: [Tutor] Final de-allocation before the application exists
Hi friends,=20
=20
I am developing an module where I allocate certain threads and =
memory in the module and an application would use this allocated =
resources. I would like to know whether Python provides any function =
which would be called at the end of the life cycle of the application or =
just before the application exits. =20
=20
I would like to know whether to know since, I would like to hide =
this function in my module and not force the user to call the function. =
This would remove the dependency on the user to specifically call the =
function. Also if there is such a function , I can make sure that the my =
module resources are de-allocated gracefully.=20
Please let me know incase this can be possible.
with regards,=20
K Dhanvi
------=_NextPart_000_0115_01C35072.6A148790
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style=3D"COLOR: #000000; FONT-FAMILY: Arial" bgColor=3D#ffffff>
<DIV><FONT size=3D2>Sorry about my english in the previous mail. =
</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I re-state my question in this mail : </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2> I would like to know whether Python has a =
function=20
which would be called just before the end of the application. I cannot =
use=20
destructors in my application because I have some static data in my =
application=20
that is modified during the life cycle of the application. If I =
have any=20
function like this , then I could hide the gory details of de-allocation =
of=20
resources completely from the user. This way, what he ( =
user ) does=20
not know, he need not be bothered about :).. </FONT></DIV>
<DIV><FONT size=3D2> ( I am allocating the resources and threads =
in my=20
module which is used by an application. I would like to de-allocate =
resources in the application )</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>well thats my query.. incase theres something I am =
missing in=20
my approach please point me out .. thanks a lot for your time and=20
help.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT face=3Darial size=3D2>with regards, <BR>K Dhanvi</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3Ddhanvik@gmx.net href=3D"mailto:dhanvik@gmx.net">K =
Dhanvi</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A title=3Dtutor@python.org =
href=3D"mailto:tutor@python.org">tutor@python.org</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, July 22, 2003 =
4:30=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Tutor] Final =
de-allocation=20
before the application exists</DIV>
<DIV><BR></DIV>
<DIV><FONT size=3D2>Hi friends, </FONT></DIV>
<DIV><FONT size=3D2> </FONT></DIV>
<DIV><FONT size=3D2> I am developing an module where I allocate =
certain=20
threads and memory in the module and an application would use =
this=20
allocated resources. I would like to know whether Python provides =
any=20
function which would be called at the end of the life cycle of =
the=20
application or just before the application exits. =
</FONT></DIV>
<DIV><FONT size=3D2> </FONT></DIV>
<DIV><FONT size=3D2> I would like to know whether to know =
since, =20
I would like to hide this function in my module and not =
force=20
the user to call the function. This would remove the dependency =
on the=20
user to specifically call the function. Also if there is such a =
function , I=20
can make sure that the my module resources are de-allocated =
gracefully.=20
</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2> Please let me know incase this can =
be=20
possible.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT face=3Darial size=3D2>with regards, <BR>K=20
Dhanvi</FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0115_01C35072.6A148790--