[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-patches
Subject:    Re: timer fix
From:       Jud Valeski <valeski () netscape ! com>
Date:       1998-10-19 19:24:50
[Download RAW message or body]

Thanks Joe. I checked in your patch a minute ago. Good eye! The call netlib
all the time thing is obviously a stretch, but, your patch at least cleans
it up.

Jud

Joe Keane wrote:

> So there's this `call netlib all the time' thing, which i don't really
> understand.  It has a counter to remember how many things want it on.
> Well OK, but you don't need *that many* timers going off 1000 times
> per second.  That can be 20,000 per second or more.  I mean really!
>
> Here's a patch to netlib.  This is relative to the 19980904 snapshot;
> if you have that, this makes it better.  It's just a patch; it's much
> better if the whole `call netlib all the time' thing just goes away.
>
> I found no difference in behavior, if you don't watch the load meter.
> Let me know if you notice anything different.
>
> *** mkselect.c.old      Fri Sep  4 11:18:12 1998
> --- mkselect.c.good     Wed Sep 30 09:51:31 1998
> ***************
> *** 186,209 ****
>   void
>   net_process_net_timer_callback(void *closure)
>   {
> !       if(!NET_ProcessNet(NULL, NET_EVERYTIME_TYPE))
> !               return;  /* dont reset the timer */
>
> !       if(net_calling_all_the_time_count)
>                 FE_SetTimeout(net_process_net_timer_callback, NULL, 1);
>   }
>
>   MODULE_PRIVATE void
>   NET_SetCallNetlibAllTheTime(MWContext *context, char *caller)
>   {
> !       if(net_calling_all_the_time_count < 0)
> !       {
> !               PR_ASSERT(0);
> !               net_calling_all_the_time_count = 0;
> !       }
>
>   #ifdef USE_TIMERS_FOR_CALL_ALL_THE_TIME
> !       FE_SetTimeout(net_process_net_timer_callback, NULL, 1);
>   #endif /* USE_TIMERS_FOR_CALL_ALL_THE_TIME */
>
>         net_calling_all_the_time_count++;
> --- 186,210 ----
>   void
>   net_process_net_timer_callback(void *closure)
>   {
> !       PR_ASSERT(net_calling_all_the_time_count >= 0);
> !
> !       if (net_calling_all_the_time_count == 0)
> !               return;
>
> !       if (NET_ProcessNet(NULL, NET_EVERYTIME_TYPE) == 0)
> !         net_calling_all_the_time_count = 0;
> !       else
>                 FE_SetTimeout(net_process_net_timer_callback, NULL, 1);
>   }
>
>   MODULE_PRIVATE void
>   NET_SetCallNetlibAllTheTime(MWContext *context, char *caller)
>   {
> !       PR_ASSERT(net_calling_all_the_time_count >= 0);
>
>   #ifdef USE_TIMERS_FOR_CALL_ALL_THE_TIME
> !     if (net_calling_all_the_time_count == 0)
> !       FE_SetTimeout(net_process_net_timer_callback, NULL, 1);
>   #endif /* USE_TIMERS_FOR_CALL_ALL_THE_TIME */
>
>         net_calling_all_the_time_count++;
> ***************
> *** 245,258 ****
>   MODULE_PRIVATE void
>   NET_ClearCallNetlibAllTheTime(MWContext *context, char *caller)
>   {
> !       if(net_calling_all_the_time_count < 1)
> !       {
> !               PR_ASSERT(0);
> !               net_calling_all_the_time_count = 1;
> !       }
>
>         net_calling_all_the_time_count--;
> -
>   }
>
>   MODULE_PRIVATE PRBool
> --- 246,254 ----
>   MODULE_PRIVATE void
>   NET_ClearCallNetlibAllTheTime(MWContext *context, char *caller)
>   {
> !       PR_ASSERT(net_calling_all_the_time_count > 0);
>
>         net_calling_all_the_time_count--;
>   }
>
>   MODULE_PRIVATE PRBool

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic