public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] question about the posix package
@ 2003-12-29 11:21 Stefano Martini
  2003-12-29 21:10 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Stefano Martini @ 2003-12-29 11:21 UTC (permalink / raw)
  To: ecos-discuss

Hi. I am in the process of porting to ecos a library using the pthread
paradigm to support multithreaded safeness.
At the end, this lib will be used by an existing ecos application (not
using the posix package).
Assumig to enable the posix package in my ecos build, can an ecos
application (written not for posix) and a lib
on top of posix work toghether?
In other words, should I rewrite the ecos application to also use pthread?

Thanks in advance,

Stefano Martini



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

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

* Re: [ECOS] question about the posix package
  2003-12-29 11:21 [ECOS] question about the posix package Stefano Martini
@ 2003-12-29 21:10 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2003-12-29 21:10 UTC (permalink / raw)
  To: Stefano Martini; +Cc: ecos-discuss

On Mon, Dec 29, 2003 at 11:29:02AM +0100, Stefano Martini wrote:
> Hi. I am in the process of porting to ecos a library using the pthread
> paradigm to support multithreaded safeness.
> At the end, this lib will be used by an existing ecos application (not
> using the posix package).
> Assumig to enable the posix package in my ecos build, can an ecos
> application (written not for posix) and a lib
> on top of posix work toghether?
> In other words, should I rewrite the ecos application to also use pthread?

Im not clear what you mean exactly. So i will answer in a more general
way.

Thread safeness is to do with the sharing of resources. If threads
don't share the same resources, you don't have anything to worry
about. 

If threads do share resources then you need to be thread safe. So you
need to use mutex, semaphores etc. There are two sets of API which
provide the needed primitives. There are the native eCos primitive
cyg_mutex_*, cyg_sem_* etc. And there are the POSIX equivalent. 

To be safe, you don't want to mix up posix and eCos primitives in the
same thread. It is OK to have one set of threads using eCos primitives
and another set of threads using POSIX threads.

Does this answer your question?

     Andrew

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

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

end of thread, other threads:[~2003-12-29 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-29 11:21 [ECOS] question about the posix package Stefano Martini
2003-12-29 21:10 ` Andrew Lunn

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).