Re: thread priority ?

Vladimir Tzankov <[email protected]> Sat, 16 Dec 2017 23:18:41 +0200
Newsgroups gmane.lisp.clisp.general
Message-ID <CAHWYE6KnfOmPu3Boxp3PVo51swiLTajFrmKxH+ru4CErYuWHHQ@mail.gmail.com>
Don,

Supply/demand is common problem but playing with thread priorities is the
wrong way to handle it.
Better approach is to do it applications level - e.g. priority queues with
thread pools.

Also there are differences how OS-es implement thread priorities (even
between releases) - I don't think there is a way to have consistent
behaviour.

BR
  Vlad

On Fri, Dec 8, 2017 at 1:02 AM, Don Cohen <don-sourceforge-x2012@isis.
cs3-inc.com> wrote:

> Vladimir Tzankov writes:
>
>  > I purposely avoided exposing thread priorities. I've yet to see
>  > legit use case for playing with these.
>
> It sounds like you want me to provide such use cases.
> The problem is that we have a limited number of processors and a
> limited amount of bandwidth and other resources, but a potentially
> unlimited demand.  When the demand exceeds the supply then I want
> to favor some activities over others.  For instance, something a
> user is waiting for gets priority over something going on in the
> background that will ultimately generate an email report.
> If some users request a lot of service I'd rather have them wait
> for some of it than impact the service provided to other users who
> request much less.  So, for instance, I might assign priority
> based on how much service a user has already received plus the
> estimated costs of his requests currently in the queue ahead of
> this one (so lower value is "higher" priority).
>
> BTW, it would be helpful to know what the priorities are allowed
> to be.  In my example above it would be useful for them to be
> arbitrary numbers, but if they have to be integers in some range,
> I have to know what that range is, and whether higher numbers are
> higher or lower priority than lower numbers.  I'm currently imagining
> that whenever two threads are both ready to run and we have capacity
> for only one, we take the one with higher (or lower?) priority value.
> Is that right?
>
>  > Anyway, it's rather simple to add support for setting threads
>  > priorities.
>
> That's what I imagined and hoped.
>
>  > --
>  >   Vlad
>  >
>  > On Thu, Nov 30, 2017 at 5:18 PM, Don Cohen <
>  > [email protected]> wrote:
>  >
>  > >
>  > > My impression is that threads can have priorities that affect
>  > > scheduling.  But I don't see any mention in impnotes of this.
>  > > If it's easy (I hope so), perhaps some interfaces could be
>  > > added to read/write/initialize the priority of a thread?
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list