[erlang-questions] A problem with ETS + SMP

Taavi Talvik taavi@REDACTED
Wed Mar 26 23:05:57 CET 2008

On Mar 26, 2008, at 11:29 PM, Gene Sher wrote:
> My program has a large number of parallel operating processes (it's  
> a neural network, each process is a neuron), each process has its  
> own ETS table (set,private). each process does a bit of work on it's  
> own table, and then sends a message to another process....
>  I reprogrammed the entire thing using only a single public ets  
> table (just to see the difference), the single cpu program didn't  
> change its speed, but the quad core increased execution time even  
> further. Rewriting the program in dict, does on the other hand speed  
> up the execution when moving from single core to quad core.
> I've tested this setup without most of the calculations done in each  
> process to see what happens with just message passing(second order  
> derivatives...and other calculation, disabled) same problem occurs.  
> I've now tried the code on a single CPU laptop, very peculiar thing  
> happens. Without smp enabled it runs at ~300us per pass, with smp  
> enabled (and it still only has 1 cpu, I simply: erl -smp), it goes  
> up to ~450us still. Something funny is going on with the smp and ets.

Problem description sounds like especially good candidate for
inclusion in Erlang/OTP regression test set. It probably excersises
feature which is different from feature set OTP team is used to.

Hopefully OTP team will work together with you to include it in
test set.

And of course to find improvements;)

best regards,

More information about the erlang-questions mailing list