This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: TCP/IP stack questions



On 29-Mar-00 Grant Edwards wrote:
> 
> I've got a couple questions about the TCP/IP stack that we
> haven't been able to answer after a brief look through the
> source code:
> 
>  1) Can you do a non-blocking accept() on a socket?
>
 
Yes.  However, the easiest way to do this is to use 'select()'
on the socket after you have done a 'listen()'.

>  2) Does the stack start any tasks of its own?  If so what are
>     their priorities?  Our application has one task that never
>     blocks, so if anybody creates a task with a lower priority
>     than that, it will never run.  ;)
> 

Yes, there is one additional thread started by the network code.
This thread runs background maintenance and helps move data through
the stack as it comes in via interrupts.

The background thread priority is set up using this CDL:
    cdl_option CYGPKG_NET_THREAD_PRIORITY {
        display "Priority level for backgound network processing."
        flavor  data
        default_value 7
        description   "
            This option allows the thread priority level used by the
        networking stack to be adjusted by the user.  It should be set
        high enough that sufficient CPU resources are available to
        process network data, but may be adjusted so that application
        threads can have precedence over network processing."
    }

Your "never blocking" thread would need to have a priority value of 8
or higher (logically lower than the networking thread).

BTW why does your thread never block?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]