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



Relevant Pages

  • Re: dynamically allocated memory
    ... memory allocation function fails, they take memory from the emergency pool. ... they replenish the emergency pool. ... all the mission-critical applications I have managed that started on straight 'malloc' eventually migrated to their own memory allocators. ... have been reasons for malloc replacement in systems I've been involved with. ...
    (comp.unix.programmer)
  • Re: Malloc Query
    ... amount of overhead in terms of calling the same. ... significant advantage in providing user defined malloc() and free. ... memory allocation and de-allocation in a much better way than what OS ... They go on to call an OS space allocator ...
    (comp.lang.c)
  • Re: dynamically allocated memory
    ... > memory allocation function fails, they take memory from the emergency ... they replenish the emergency pool. ... I'm aware that really mission critical apps rarely use malloc ...
    (comp.unix.programmer)
  • Re: Memory allocation problem
    ... Linux follows an optimistic memory allocation strategy. ... This means that when malloc() returns non-NULL there is no guarantee ... But the mallocbug is still there. ...
    (alt.os.linux)
  • Re: Locking, locking...
    ... > As we all knew size of list could be changed when we were in malloc(). ... Recall memory allocation? ... increase and decrease it repeatedle. ... then there is a DoS in terms of memory allocation anyway. ...
    (freebsd-hackers)