Re: Multithreaded applications

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 01/04/2014 10:43 AM, German Vidal wrote:
> Hi,
> 
> anyone knows if there's a way to control the scheduling policy when
> implementing multithreaded applications?

Not as yet.  I guess you refer to setting priorities?

> And, if this is not the case, which scheduling is used in the current
> implementation?

A new Prolog thread is based on a POSIX thread using default arguments.
The Windows version uses the pthread-win32 emulation to create the thread.

The only thing that touches scheduling is thread_setconcurrency/2 (which
only has effect on a few platforms).

I should not be a problem to add additional options to thread_create/3
and/or encapsulate other POSIX thread scheduling primitives.

Ideally, figure out what is needed and submit a patch.  The file you need is
src/pl-thread.c

	Cheers --- Jan
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.