This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Task suspension and resumption in POSIX
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: "Ali, Khurram" <Khurram_Ali at mentorg dot com>
- Cc: "Gary Thomas" <gary at mlbassoc dot com>,"eCos Discussion" <ecos-discuss at ecos dot sourceware dot org>
- Date: 08 Apr 2005 18:00:47 +0100
- Subject: Re: [ECOS] Task suspension and resumption in POSIX
- References: <32A0F6EE19ECF646A9CF370C3AB15EBE01109DF5@SVR-ALH-EXC-02.mgc.mentorg.com>
"Ali, Khurram" <Khurram_Ali@mentorg.com> writes:
> I am actually creating an API that can be called by multiple threads
> simultaneously. This includes threads that my code may have not created.
>
> I was actually using semaphores myself previously. I associated a
> semaphore with a task.
>
> However, an application task that is not created in my code does not
> have an associated semaphore. How do I suspend this task? I would have
> to associate semaphores with a task within the suspend function. This
> would mean I would have to create a semaphore at each call to suspend
> and delete it in each call to resume. Or I would have to have a pool of
> semaphores.
>
> I just thought that if I could do something as simple as what I am doing
> below.
You really shouldn't be suspending threads that you did not create
yourself. Such threads may be vital to the continued functioning of
the system. You have even less knowledge of what they may be doing,
and the potential for damage or deadlock is even higher.
--
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