[Top][All Lists]

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

RE : [lwip-users] Thread issues In Ada

From: Frédéric BERNON
Subject: RE : [lwip-users] Thread issues In Ada
Date: Mon, 10 Sep 2007 12:21:46 +0200

First, which lwIP release do you use ?
1. To fix that, you should handle this concurrent access in your code (tcip_init is supposed called only one time). Something like :
void tcpip_package_init()
{ static int done=0;
  if (!done) {
Of course, there is always a little time where "done" can be tested by app2 before app1 set it to 1, but you reduce the delay. Perhaps you could declare and initialize a mutex at your OS level, and use it around the "if (!done)" block.
2. If you don't use :
- (lwip_)select
- sys_msleep
- sys_sem_wait_timeout
So, you should use any sequential API (socket or netconn), and just return in your sys_arch_timeouts a pointer to a static "struct sys_timeouts" (since in this case, only tcpip_thread use "timeouts").
I hope it will help you...
Frédéric BERNON
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@hiddenr
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 KATZIR SHAY
Envoyé : lundi 10 septembre 2007 09:43
À : address@hidden
Objet : [lwip-users] Thread issues In Ada


I'm trying to port the lwip to a real-time embedded system, which relies on ada.
Meanwhile, I came across the following problems:

1. tcpip_init_done() is defined as a static variable, although it is initialized by different applications.
  Therefore, it is possible that if we have 2 apps: app1 and app2. and, both of them initialize the tcpip package with init1 and init2,
   a context switch in tcpip_thread (after the new thread has started) can cause the tcpip_init_done() to change before it is called.

2. In order to create the sys_arch_timeouts, I need to identify the operating thread at each call, and it is impossible for me.
    Why the timeouts lists can't be stored in an internal struct of the lwip, such as netif, or any other struct which is specific for the thread and passed on
    over the functions, and therefore can be accessed at any time.


This message (including any attachments) issued by RAFAEL-ARMAMENT DEVELOPMENT AUTHORITY LTD. (hereinafter "RAFAEL") contains confidential information intended for a specific individual and purpose, may constitute information that is privileged or confidential or otherwise protected from disclosure. If you are not the intended recipient, you should contact us immediately and thereafter delete this message from your system. You are hereby notified that any disclosure, copying, dissemination, distribution or forwarding of this message, or the taking of any action based on it, is strictly prohibited. If you have received this e-mail in error, please notify us immediately by e-mail mailto:address@hidden and completely delete or destroy any and all electronic or other copies of the original message and any attachments thereof.

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

reply via email to

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