Julian Seward wrote:
> On Wednesday 29 October 2008, Darryl Miles wrote:
> [...]
> 
> I see what you're saying.  However ...
> 
>> Then when VGs default scheduler selects the next thread to run there is
>> also another event simply to notify the custom scheduler this is
>> happening (for which the return value is ignored).
> 
> you still seem to assume that Valgrind has some control over which
> thread runs next.  And it doesn't.  A long time ago, in versions prior
> to 2.2.0, V did do thread scheduling, by running all application threads
> in one OS-level thread, but those days are long gone.  Nowadays, if
> an application creates N threads running natively, it will have N threads
> when running on Valgrind too.

True, but we can control which threads are runnable - we already do so 
to ensure that only one thread runs at once.

> In that case, Valgrind is somewhat irrelevant.  An equivalent problem
> (it seems to me) is this: for a threaded program running natively,
> how do you force the Linux kernel to run a thread of your choice 
> next, when there is more than one runnable thread?  I don't know
> how.  You can do sys_yield(), but that's only a hint to the kernel;
> it doesn't _force_ anything to happen.

You force it by ensuring that all threads except the one you want to run 
are blocking on some resource. That way the kernel has no choice about 
which thread to schedule.

I'm not saying it's a good idea to support this at all mind, just that 
it may well be possible.

Tom

-- 
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to