Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion gen_server message queue length increasing
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Magnus Klaar  
View profile  
 More options Nov 4 2011, 10:22 am
From: Magnus Klaar <magnus.kl...@gmail.com>
Date: Fri, 4 Nov 2011 15:22:47 +0100
Local: Fri, Nov 4 2011 10:22 am
Subject: Re: [erlang-questions] gen_server message queue length increasing

Hi!

@Wang

It is not ok to let a gen_server delete itself because it is not guaranteed
to delete the reference associated with it from the shared table. This
approach will leak memory unless the child processes don't exit under ideal
conditions.

@Zvi

when you both link and monitor the child process you are doubling the
amount of work your server needs to keep up with, since you are already
linked you can skip monitoring.

There is also one possible issue with your server which is that you are
starting the child processes directly from the same server receiving the
EXIT and DOWN messages. In the process info you included you can see that
the current function is proc_lib:sync_wait, this call happens to be
inefficient on processes with large inboxes, it'll likely turn out to be
much more of a bottleneck than the ETS calls in delete_by_pid.

MVH Magnus

On Fri, Nov 4, 2011 at 3:36 AM, Wang Wei <w...@sxu.edu.cn> wrote:
> Hi, Is it ok to let spawned gen_servers delete themselves in ETS table
> when they terminated? If you spawn and destroy too fast that will a lock
> condition in the main gen_server.

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.