erl_interface and ALIVE

Gordon Beaton
Tue Sep 12 13:34:41 CEST 2000

In erix.mailing-list.erlang-questions, you wrote:
> Yes, but check out the times!  My buffers are filling up
> with these messages as they are produced many times a second.
> This seems to be produced by run_erl.  In run_erl.c:
>   /* Enter the work loop */
>   timeout.tv_sec  = LOG_ALIVE_MINUTES*60;
>   timeout.tv_usec = 0;
>   while (1) {
>     maxfd = MAX(rfd, mfd);
>     FD_ZERO(&readfds);
>     FD_SET(rfd, &readfds);
>     FD_SET(mfd, &readfds);
>     time(&last_activity);
>     ready = select(maxfd + 1, &readfds, NULL, NULL, &timeout);

Now I see it...

Since select() modifies the contents of timeout on some systems
(notably linux), it needs to be (re-) set on each pass of the loop
(before select() is called), not outside the loop as in your version.

This has already been fixed in r7a.


g o r d o n . b e a t o n @ e r i c s s o n . c o m
software architecture laboratory
ericsson research
stockholm, sweden

More information about the erlang-questions mailing list