lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE : [lwip-users] sys_mbox_fetch & sys_mbox_fetch_timeout compatible?


From: Frédéric BERNON
Subject: RE : [lwip-users] sys_mbox_fetch & sys_mbox_fetch_timeout compatible?
Date: Wed, 18 Apr 2007 09:22:47 +0200

Hi Andrew,

There is only one function, and it's name is decided by LWIP_SO_RCVTIMEO option 
(default per default). There was many discutions about this point (because, if 
you don't need to use sys_timeout at application level, api_lib could replace 
sys_mbox_fetch per directly sys_arch_mbox_fetch). But, in your case, I suppose 
you have set LWIP_SO_RCVTIMEO=0. So, only sys_mbox_fetch is defined. In this 
case, the code SHOULDN'T have changed (you can take the older define, this is a 
fast test to do).

> However, sys_mbox_fetch is blocking with no timeout.
Perhaps the problem is not from sys_mbox_fetch_timeout: with it, you just don't 
wait forever if your never get any message, that's all. But an error is always 
possible, but, because lot of users don't use LWIP_SO_RCVTIMEO, I think a such 
problem will already be signaled...

It's possible that the problem come from the simhost.c sample. You say that you 
"attempting to implement a true 2 thread version of simhost using the 
sockets interface.". Can you tell me what you have change to do that (send the 
code please)? When you got the hang, in which part of the code you are (and in 
which line)?

I'm will not at the office until next Thursday, so, I hope someone else can 
help you about that (I will check my emails, but...).

  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Andrew Lentvorski
Envoyé : mercredi 18 avril 2007 05:42
À : Mailing list for lwIP users
Objet : [lwip-users] sys_mbox_fetch & sys_mbox_fetch_timeout compatible?


I'm attempting to implement a true 2 thread version of simhost using the 
sockets interface.  To do that, I need to break into the tcpip_thread 
loop and poll the hardware interface and then poll the message queue and 
then loop (currently, simhost uses at least 3 threads).

However, sys_mbox_fetch is blocking with no timeout.  It looks like I 
need sys_mbox_fetch_timeout.

This scares me a bit.

Is sys_mbox_fetch just sys_mbox_fetch_timeout(mbox, msg, 0)?  If so, why 
the compile switch required to change between them?  Why aren't *both* 
functions provided?  Why isn't sys_mbox_fetch implemented in terms of 
sys_mbox_fetch_timeout?

Can I just use sys_mbox_fetch_timeout(mbox, msg, 1) to do what I want? 
What are the downsides to this (other than high CPU and a 1 millisecond 
lag before handling the next packet)?

Thanks,
-a


_______________________________________________
lwip-users mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]