Re: [PATCH] fixes an issue when main thread is sleeping when receiving data.

Alejandro Guerrieri <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hmm, could this be related with the problem I was having when  
developing "membox"?

I've experienced similar freezing problems when enqueuing at high  
speed, but didn't know where the problem was. I'm definitely having a  
second look at it with this patch as well.

Regards,

Alejandro
--
Alejandro Guerrieri
[email protected]



On 30/04/2009, at 12:10, Alexander Malysh wrote:

> hi Vincent,
>
> please try attached patch. The mtbatch freeze because in main we try  
> to join all threads (gwthread_join_all) but
> in read_messages_from_bearerbox we blocked infinite waiting for acks  
> from bearerbox.
>
> Thanks,
> Alex
> <mtbatch-freeze.diff>
>
> Am 17.04.2009 um 11:35 schrieb Vincent CHAVANIS:
>
>>
>> I've experiences somes troubles when sending 3500 msg/sec
>> Sometimes, the main thread_id is freezed.
>>
>>
>> # On the code executed below:
>>
>>   sended = run_batch();
>>
>>   info(0," mark#1 ");
>>
>>   /* avoid exiting before sending all msgs */
>>   while(sended > counter_value(counter)) {
>>       info(0," mark#2 ");
>>       gwthread_sleep(0.1);
>>   }
>>
>>
>> # i got this:
>>
>> 2009-04-17 11:31:55.0720 [22720] [0] DEBUG: message length 130,  
>> sending 1 messages
>> 2009-04-17 11:31:55.0720 [22720] [0] DEBUG: message length 130,  
>> sending 1 messages
>> 2009-04-17 11:31:55.0720 [22720] [0] DEBUG: message length 130,  
>> sending 1 messages
>> 2009-04-17 11:31:55.0721 [22720] [0] DEBUG: message length 130,  
>> sending 1 messages
>> 2009-04-17 11:31:55.0721 [22720] [0] INFO: mtbatch has processed  
>> 999 messages with 0 errors
>> 2009-04-17 11:31:55.0721 [22720] [0] INFO:  mark#1
>> 2009-04-17 11:31:55.0721 [22720] [0] INFO:  mark#2
>> (freezed)
>> ^C
>>
>>
>>
>>
>> Alexander Malysh a écrit :
>>> Hi,
>>> I don't get it, why this patch is needed? Could you please  
>>> describe in detail?
>>> Thanks,
>>> Alex
>>> Am 16.04.2009 um 12:36 schrieb Vincent CHAVANIS:
>>>>
>>>> - When main thread is sleeping and receiving data by bearerbox,
>>>> we will be into an infinite loop.
>>>>
>>>> This patch fix this by waking-up the main thread.
>>>>
>>>> Vincent.
>>>>
>>>>
>>
>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.