lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP capabilities


From: Robert Morse
Subject: Re: [lwip-users] LWIP capabilities
Date: Wed, 18 Apr 2007 17:06:34 -0400


On Apr 18, 2007, at 4:44 PM, Jonathan Larmour wrote:

Robert Morse wrote:

My driver, in the receive interrupt, just messages a HIGH priority task, to actually
handle passing the data into the lwip stack.

How specifically does it do that? Does it call etharp_ip_input() directly for example?


I have an task that waits for a message from the ethernet interrupt handler.
It then does:

loop {
        sys_arch_mbox_fetch( handler_mbox, &dummy, 0 );
        while ( (pbuf = low_level_input()) != NULL )
        {
                switch( ethhdr->type )
                        case ETHTYPE_IP:
                                ....
                        case THETYPE_ARP:
                                etharp_arp_input(netif, addr, pbuf)
        }
}
I had this all done in the interrupt routine, but trying to protect the memory allocation for both interrupt and task, just did not seem like it was that protective of each other.
So I created a task that did the creating of the pbufs.


Although I can't see any immediate problem in what is in your description, this sounds a lot like an inter-thread locking problem of some sort.


Ya, that is what I think it is.

I assume you are using the sequential (netconn) API. The most obvious thing to bear in mind is that the thread-safety is limited - you should only use one connection in one thread at one time. You can't use the same connection in two different threads at one time.


I am using the 'bsd' interface, socket, accept, send, recv. Which I believe sit on top of the netconn layer.

The only place where two threads interact is I have a thread doing a listen, which then passes the return socket to another thread that does all the communications. So I guess you would say that one thread is doing an open, while another thread is doing everything else up to the close.


Ok,
This is what I wanted to hear. I will keep looking at where a possible dead lock is happening.

Robert


Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------ Opinions==mine


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






reply via email to

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