This is the mail archive of the ecos-discuss@sources.redhat.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]
Other format: [Raw text]

Re: Task suspension and resumption in POSIX


"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


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