public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] FreeBSD stack / more threads, one socket
@ 2004-08-30 11:56 Richard Rauch
  2004-08-31 10:18 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Rauch @ 2004-08-30 11:56 UTC (permalink / raw)
  To: ecos-discuss

Hi all,

we are using the FreeBSD stack and our application works with several
threads.
on one socket there are working 2 threads. the first is thread is waiting
for socket events with select( ), the second thread is calling send( ) and
receive( ).
is this allowed?
I'm asking, because when we have heavy communication load, then the stack
hangs (e.g no answers to ping) and we are searching for the reason

Thanks in advance

Richard



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] FreeBSD stack / more threads, one socket
  2004-08-30 11:56 [ECOS] FreeBSD stack / more threads, one socket Richard Rauch
@ 2004-08-31 10:18 ` Nick Garnett
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2004-08-31 10:18 UTC (permalink / raw)
  To: Richard Rauch; +Cc: ecos-discuss

"Richard Rauch" <Richard.Rauch@vipa.de> writes:

> Hi all,
> 
> we are using the FreeBSD stack and our application works with several
> threads.
> on one socket there are working 2 threads. the first is thread is waiting
> for socket events with select( ), the second thread is calling send( ) and
> receive( ).
> is this allowed?
> I'm asking, because when we have heavy communication load, then the stack
> hangs (e.g no answers to ping) and we are searching for the reason

I don't think that the BSD stack really expects you to be doing IO on
a socket that you are also selecting on. To start with, it would be
totally non-deterministic what happens when a packet arrives, does it
satisfy the recv() or the select(). Similarly with transmit, when the
buffers empty enough to allow a new transmission, does it satisfy the
select(), or release the send()?

I think you need to look more closely at your program, there seems to
be some confusion about what it want to do with this socket. I would
certainly never structure a program like this, on eCos, BSD or Linux.

Of course your problems may be unrelated, but I think this needs
fixing if only to eliminate it as a source of bugs.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-31 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-30 11:56 [ECOS] FreeBSD stack / more threads, one socket Richard Rauch
2004-08-31 10:18 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).