Re: [lazarus] Something like SetThreadAffinityMask for Unix/Linux?

2008-02-04 Thread Marco Alvarado
Sorry for asking, what is FPC's tmt1 ?

-Marco

2008/2/4, Mark Morgan Lloyd [EMAIL PROTECTED]:
 I wonder whether it would be possible to patch affinity support into the
 underlying TThread object? OTOH I'm currently looking at FPC's tmt1 running
 under Linux on a 14-processor system and I can see it being spread fairly
 evenly, so this is getting pretty specialist.

 Micha Nelissen wrote:
  Marco Alvarado wrote:
  I'm using SetThreadAffinityMask() on Windows to set the processor for
  a given TThread object. What can I use on Linux?
 
  On linux you could use sched_setaffinity, but I don't think fpc has
  wrapped that yet. Linux man page says it's linux specific.

 --
 Mark Morgan Lloyd
 markMLl .AT. telemetry.co .DOT. uk

 [Opinions above are the author's, not those of his employers or colleagues]

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Something like SetThreadAffinityMask for Unix/Linux?

2008-02-04 Thread Mark Morgan Lloyd

Marco Alvarado wrote:

Sorry for asking, what is FPC's tmt1 ?

-Marco

2008/2/4, Mark Morgan Lloyd [EMAIL PROTECTED]:

I wonder whether it would be possible to patch affinity support into the
underlying TThread object? OTOH I'm currently looking at FPC's tmt1 running
under Linux on a 14-processor system and I can see it being spread fairly
evenly, so this is getting pretty specialist.

Micha Nelissen wrote:

Marco Alvarado wrote:

I'm using SetThreadAffinityMask() on Windows to set the processor for
a given TThread object. What can I use on Linux?

On linux you could use sched_setaffinity, but I don't think fpc has
wrapped that yet. Linux man page says it's linux specific.


tmt1 is part of the test suite when FPC (Free Pascal, the compiler that 
underlies Lazarus) is built. Specifically, it tests threading and was broken 
until comparatively recently on SPARC and possibly some other non-x86 
platforms. I'd fired a big Sun up to specifically to check something related 
to that program, so it was obviously no effort to look at the CPU usage after 
noticing your query.


Apologies to everybody for the earlier top-posting. I alternate between 
environments where the different conventions are appropriate.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Something like SetThreadAffinityMask for Unix/Linux?

2008-02-04 Thread Mark Morgan Lloyd
I wonder whether it would be possible to patch affinity support into the 
underlying TThread object? OTOH I'm currently looking at FPC's tmt1 running 
under Linux on a 14-processor system and I can see it being spread fairly 
evenly, so this is getting pretty specialist.


Micha Nelissen wrote:

Marco Alvarado wrote:

I'm using SetThreadAffinityMask() on Windows to set the processor for
a given TThread object. What can I use on Linux?


On linux you could use sched_setaffinity, but I don't think fpc has
wrapped that yet. Linux man page says it's linux specific.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Something like SetThreadAffinityMask for Unix/Linux?

2008-02-04 Thread Micha Nelissen
Mark Morgan Lloyd wrote:
 I wonder whether it would be possible to patch affinity support into the
 underlying TThread object? OTOH I'm currently looking at FPC's tmt1
 running under Linux on a 14-processor system and I can see it being
 spread fairly evenly, so this is getting pretty specialist.

Indeed, Linux scheduling is quite good (much better than e.g. Windows
which seems to move processes back and forth all the time between
processors).

Micha

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Something like SetThreadAffinityMask for Unix/Linux?

2008-02-02 Thread Micha Nelissen
Marco Alvarado wrote:
 I'm using SetThreadAffinityMask() on Windows to set the processor for
 a given TThread object. What can I use on Linux?

On linux you could use sched_setaffinity, but I don't think fpc has
wrapped that yet. Linux man page says it's linux specific.

Micha

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives