<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Is ETS utilizing the same locking policy for all
table types (namely: public, protected or private), and if so, would it be
possible to relax locking for protected and private access? </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We've noticed that if more than one process
requires an access to the same ets table (in SMP environment), the system slows
down considerably due to the locking mechanism. It is quite possible to
optimize this by fronting such a table with a dedicated process for request
serialization -- works better as there is always only one proccess requesting a
lock. </FONT><FONT face=Arial size=2> Actually... as much as this works
well for one table, not so sure how would such an "optimization" work for a
large number of tables. By relaxing (or not having) a locking policy for (at
least) tables with a private access, there would be no questions about
it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>V.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=erlang-questions_efine@usa.net
href="mailto:erlang-questions_efine@usa.net">Edwin Fine</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=erlang-questions@erlang.org
href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, September 02, 2008 7:09
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [erlang-questions] Parallelism,
SMP, and multicore question</DIV>
<DIV><BR></DIV>
<DIV dir=ltr>Since the cognoscenti are talking about parallelism, maybe
someone can answer something that has been perplexing me.<BR><BR>Sometimes it
has been measurably faster on a multicore system to run one VM per core, each
with SMP disabled (or +S 1), than it is to run one or more SMP VMs. This is
true even when running code that is innately parallel. On the other hand, I
have seen benchmarks that show near-linear speedups using SMP. <BR><BR>I don't
have code to support this; it's just something I, along with a couple of other
people -- for whom I don't want to speak -- have noticed in
passing.<BR><BR>Does anyone have any insight into the internals of SMP who can
tell me when SMP might be an asset, and when a liability? I know this is a
"how long is a piece of string" question, but even though it's pretty general,
someone somewhere who really knows Erlang inside out (i.e. not me) must surely
have encountered this phenomenon.<BR><BR>Are there conditions where contention
between the threads of the SMP processes (e.g. mutexes) becomes significant
enough that multiple separate non-SMP VMs perform better? If so, what would
those conditions be?<BR><BR>Could it have anything to do with the mix of
CPU-bound processes and inter-process messaging or network I/O? If so, please
could someone explain the mechanism?<BR><BR>Anyone?<BR><BR></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>erlang-questions
mailing
list<BR>erlang-questions@erlang.org<BR>http://www.erlang.org/mailman/listinfo/erlang-questions</BLOCKQUOTE></BODY></HTML>