[erlang-questions] Improve performance of IO bounded server written in Erlang via having pollset for each scheduler and bind port to scheduler together with process

=?GB2312?B?V29qdGVrIE5hcmN6eai9c2tp?= <>
Mon Jul 16 16:27:08 CEST 2012

On 07/13/2012 03:41 PM, Wojtek Narczy¨½ski wrote:

> Maybe it would be enough to call erts_deliver_time() only if do_wait is
> true?

I checked, it would not.

> Or if that fails, create a new mutex, say erts_timedelivery_mtx, use
> erts_smp_mtx_trylock() on it, and only proceed with the time delivery,
> from the thread that succeeds in obtaining the lock. This should keep
> do_time relatively fresh.

This did not work either.

Neither calling erts_deliver_time() only if the poll call returned zero
workable descriptors.

And, because there are quite a few variables related to time, atomic
operations are not an easy solution either. Perhaps something like
seqlock, invented exactly in the context of timekeeping, would do the job.


More information about the erlang-questions mailing list