Re: delay on select()

From: Shuqing Wu (swu_at_sympatico.ca)
Date: 01/01/04


Date: Thu, 1 Jan 2004 11:12:48 -0500


> >> It is working on Solaris right now. I have not tried it on Linux yet
> >> (Since I got another problem:
> >> the execution blocked when invoke malloc(). If there is any one here
can
> >> help, I really appreciate).
>
> >You really should not do any memory allocation within the inner loop of
> >your networking code. The standard library malloc and free are protected
> >by locks besides being somewhat inefficent object management routines
> >to start with. Allocate your memory in advance and reuse it as much
> >as possible.
>
>
> If execution is blocked inside malloc(), that sounds like someone is
> calling malloc() from a signal handler.
>

No. It is not.

Shuqing