|
From: Hans - D. <dul...@eg...> - 2000-08-30 14:56:23
|
On Wed, 30 Aug 2000, Frank V. Castellucci wrote:
> Date: Wed, 30 Aug 2000 06:57:38 -0400
> From: Frank V. Castellucci <fr...@co...>
> Reply-To: cor...@li...
> To: cor...@li...
> Subject: Re: [Corelinux-develop] Recursion in EventSemaphore
>
> Hans - Dulimarta wrote:
> >
> > The signature of the EventSemaphore constructor does not have any formal
> > parameter which can be used to specify the maximum limit of listeners.
> > I could not find this either in the .mdf files.
> >
> > Again, I am assuming that the design of EventSemaphore class interface
> > is final and I am not supposed to change it.
>
> No, it was an oversight on my part as I knew it was not low fruit on the
> tree. It SHOULD have it as per the requirement.
>
OK, I have changed the the signature of EventSemaphore ctor to include
a limit of maximum listeners with the following semantic:
< 0 : infinite number of listeners
0 : no listeners are allowed
> 0 : finite number of listeners
And probably we have to add the setLimit and getLimit member functions
as well. The setLimit() function can be called only by the owner.
Any comments?
> >
> > > > So, from what I could understand by reading the code and the "manual",
> > > > for this "infinite" listener version of EvSem the recursion mode is
> > > > irrelevant. Am I making a correct assumption?
> > >
> > > It feels like it would be irrelevant to register a single thread more
> > > than once. I assume that you are tracking which threads are listening on
> > > a EventSemaphore and can detect this? If so, the question remains, is it
> > > an error or intentional usage by the user?
> >
> > How is it possible for a single thread to register more than once.
> > Once a thread register (wait for event) it will be blocked until the
> > event takes place, or if it enables balking mode it will not be registered
> > and hence it won't be blocked.
> >
> > No, I don't keep any track of who are listening to the event. I prefer to
> > make the data member of EventSemaphore as minimal as possible.
>
> Ok
>
> > >
> > > > --
> > > > Hans Dulimarta, Ph.D. dul...@co...
> > > > P: 517-432-7589 http://www.egr.msu.edu/~dulimart
> > > > F: 760-281-7691 http://corelinux.sourceforge.net
> > > > Elec. & Comp. Engg., Mich. State Univ., E. Lansing, MI 48824
> > > >
> > > > _______________________________________________
> > > > Corelinux-develop mailing list
> > > > Cor...@li...
> > > > http://lists.sourceforge.net/mailman/listinfo/corelinux-develop
> > >
> > >
> >
> > --
> > Hans Dulimarta, Ph.D. dul...@co...
> > P: 517-432-7589 http://www.egr.msu.edu/~dulimart
> > F: 760-281-7691 http://corelinux.sourceforge.net
> > Elec. & Comp. Engg., Mich. State Univ., E. Lansing, MI 48824
> >
> > _______________________________________________
> > Corelinux-develop mailing list
> > Cor...@li...
> > http://lists.sourceforge.net/mailman/listinfo/corelinux-develop
>
>
--
Hans Dulimarta, Ph.D. dul...@co...
P: 517-432-7589 http://www.egr.msu.edu/~dulimart
F: 760-281-7691 http://corelinux.sourceforge.net
Elec. & Comp. Engg., Mich. State Univ., E. Lansing, MI 48824
|