<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText58612 dir=ltr>
<DIV dir=ltr><FONT face="Courier New" color=#000000 size=2>Hi,</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>my first thought was placing it in
an ETS table, as you</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>suggested. In that way it is
changable and accessable for</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>all processes.</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>If you retrieve it to make some
calculations and then</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>only use the result, the retrieved
data will eventually be</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>garbage collected away from the
process, is that is not</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>satisfactory? I can imagine a
situation where several</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>(thousands of) processes have
copies (of the same data)</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>which sits and waits </FONT><FONT
face="Courier New" size=2>to be garbage-collected. It will of</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>course take up space </FONT><FONT
face="Courier New" size=2>until it is GC:ed. And the fact that</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>it sits and can be </FONT><FONT
face="Courier New" size=2>GC:ed in one process does not help you</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>if another process </FONT><FONT
face="Courier New" size=2>is the one causing your memory to run
out.</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>Next idea: Can you make
calculations on the data in</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>one single process, passing
request-reply to/from that</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>process? (This will prevent you
from having simultaneous</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>copies of the the same data in
several processes waiting</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>for it to be garbage
collected).</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>Best Regards,</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>Lennar</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" color=#000000
size=2></FONT> </DIV></DIV>
<DIV id=idSignature40329 dir=ltr>
<DIV><FONT face="Courier New" color=#000000
size=2>-------------------------------------------------------------</FONT></DIV>
<DIV><FONT face="Courier New" color=#000000 size=2>Lennart
Ohman
phone : +46-8-587 623 27</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sjöland & Thyselius Telecom
AB cellular: +46-70-552 6735</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sehlstedtsgatan
6
fax : +46-8-667 8230</FONT></DIV>
<DIV><FONT face="Courier New" size=2>SE-115 28 STOCKHOLM,
SWEDEN email : <A
href="mailto:lennart.ohman@st.se">lennart.ohman@st.se</A></FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Från:</B> owner-erlang-questions@erlang.org genom
Heinrich Venter<BR><B>Skickat:</B> ti 2004-10-26 10:48<BR><B>Till:</B>
erlang-questions@erlang.org<BR><B>Ämne:</B> How to get configuration data to a
large number of threads?<BR></FONT><BR></DIV>
<DIV><A
href="http://asp1.rocketseed.com/RocketSeed/mail/433a32353a3733353731353a33303639373a2d323a313933"><IMG
alt="Look 4 Help - Click here for more info" src="MTk2LjMwLjc5LjE1NQ=="
border=0></A><BR><A
href="http://asp1.rocketseed.com/RocketSeed/mail/433a32353a3733353731353a33303639373a2d323a313836"><IMG
alt=" " src="MTk2LjMwLjc5LjE1NQ==-1" border=0></A>
<P>Hello all<BR><BR>I need a bit of advice. I have a transaction based system
that spawns a<BR>thread to handle every incoming transaction. Unfortunately
there is<BR>quite a large chunk of relatively static configuration information
that<BR>is needed by every thread.<BR>With relatively static I mean that it is
changeable through user<BR>intervention at any time.<BR><BR>The question is, how
do I get this information to every thread without<BR>signifficantly slowing
things down or using up all the available memory?<BR><BR>I am not sure, but I
suspect passing it as a parameter will cause<BR>thousands of copies to be made.
Is this correct?<BR>I was thinking of making a globally registered ets table,
but this will<BR>cause copies to be made again once it is read from the
table.<BR>The last option might be to declare all the information in a hrl
file,<BR>but then changing the configuration would require recompilation.<BR>As
I understand, using a binary formated chunk of data will prevent<BR>copying, but
when converting back to a more usable format the data will<BR>be copied
again.<BR><BR>Any other ways of getting large chunks of configuration data
quickly to<BR>a large number of transient threads?<BR><BR>Help and advice
appreciated.<BR><BR>-]-[einrich Venter<BR></P><A
href="http://www.rocketseed.com/discstart.html"><BR></A>
<P></P><A href="http://www.rocketseed.com/discend.html"><BR></A>
<P></P></DIV></BODY></HTML>