Re: thread priorities?

Vladimir Tzankov <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <CAHWYE6JFe_TL02DThGE+n86qCNXG3xgOnAxs6DQM-YHLq=WByQ@mail.gmail.com>
On 4/25/12, Don Cohen <[email protected]> wrote:
> Does clisp currently have any way to manipulate thread priorities?
> Would it be easy to support?  What are the reasons it's either harder
> than it looks or not a good idea?

As of now - no. There is no way to specify or change threads priorities.
There are several caveats:
1. We have to unify what priority means across platforms. On Win32 we
have just SetThreadPriority. On Linux each thread is treated as a
process by kernel scheduler and can be assigned a scheduling policy
and priority. Not sure how it is on BSD variants.
2. On Linux in order process to be allowed to change scheduling
policy/priority of thread it needs CAP_SYS_NICE capability
(http://linux.die.net/man/7/capabilities). By default it is available
only to privileged (root) processes. So if you just download/build
clisp and run it as non-root you will not be able to change the
priority.
3. IMO, generally playing with threads priorities is bad idea. There
are very few cases where it makes sense (e.g. communication with
devices when protocol timing is important). Also note that garbage
collection is "stop-the-world" i.e. all threads are suspended during
GC.

Note that most CL implementation ignore (or does not support) thread
priorities (https://bugs.launchpad.net/sbcl/+bug/547030,
http://www.lispworks.com/documentation/lw60/LW/html/lw-234.htm#pgfId-896875,
http://ccl.clozure.com/manual/chapter7.7.html#f_make-process).

I am not against implementing it but i would set the task with low priority :).

Vladimir

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.