This might be a silly suggestion, but what would be wrong with just
creating a thread and usleeping it in a loop?


On Thu, Nov 15, 2012 at 10:31 AM, James Peach <[email protected]> wrote:
> On 14/11/2012, at 4:00 AM, 오재경 <[email protected]> wrote:
>
>> Hi. every one.
>>
>> I made a purge plugin. it creates and maintains hash memory to manage 
>> already purged objects.
>>
>> To keep hash memory slim I create a thread which clean expired objects 
>> periodically. At first I used sigaction and SIGALRM but sometimes traffic 
>> server gets hang-up.
>
> Yeh, that's not really going to work. You would have to guarantee that 
> nothing else in the process is going to use SIGALRM (which you can't do).
>
>> The log pattern showed if traffic manager signal ‘10009’ and my signal 
>> happens almost at the same time traffic server stops and doing nothing for a 
>> couple of minutes. After a while traffic server forced to shutdown and 
>> restart.
>>
>> Now I don’t use signal in my plugin. but I wonder why I can’t use signal? 
>> and How can I avoid it even when I use signal?
>
> It sounds like you should be able to use TSContScheduleEvery(). If you can't 
> do that for some reason, then you should use a mechanism that lets you safely 
> handle the signal; kevent on *BSD, probably signalfd on Linux.
>
> J
>

Reply via email to