Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2000-11

OT: Linux SMP question

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thomas Schatzl

Hello all,

I've some (general) questions about Linux and SMP and probably some of you know some pointers to information (I couldn't find the thing I was trying to search for ...).

So does someone know whether there is a library or system calls or whatever which allow assignment of particular threads or processes to a specific processor on an SMP machine ? Does not matter which language as long as it can be used with FPC... I'm currently desperately looking at such stuff but can't find a thing. :(

Thanks in advance,
Thomas

Reply by email

md
to Thomas Schatzl

Thomas,

You want to in the linux kernel sources.

You will have to recompile the kernel to provide this functionality.

The scheduler as written does not have CPU specific primitives, it is a nice general purpose scheduler
with some NICE specific additions.

The language you will use is gnu C for this.

To use this kernel modification with FPC, you will have to provide a system call so that you can set the value
of the CPU and process id for the scheduler. You may want to provide a system call to retrieve number of CPU's, but
this is probably available from somewher already, like /proc/.

Hope this helps you size up the task.

I may be working on scheduler modification in the new year if you can wait that long. I would then share
my efforts with you.

Mark Diener

Thomas Schatzl wrote 19 lines
Hello all, I've some (general) questions about Linux and SMP and probably some of you know some pointers to information (I couldn't find the thing I was trying to search for ...). So does someone know whether there is a library or system calls or whatever which allow assignment of particular threads or processes to a specific processor on an SMP machine ? Does not matter which language as long as it can be used with FPC... I'm currently desperately looking at such stuff but can't find a thing. :( Thanks in advance, Thomas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Unknown author
to Thomas Schatzl: I've some (general) questions about Linux and SMP and probably some of you know some…
Thomas Schatzl wrote 11 lines
Hello all, I've some (general) questions about Linux and SMP and probably some of you know some pointers to information (I couldn't find the thing I was trying to search for ...). So does someone know whether there is a library or system calls or whatever which allow assignment of particular threads or processes to a specific processor on an SMP machine ? Does not matter which language as long as it can be used with FPC... I'm currently desperately looking at such stuff but can't find a thing. :(

I have SMP Linux, and as far as I know, you cannot influence the CPU a particular process/thread is running.

Michael.

Show quoted text 9 lines
Thanks in advance, Thomas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Marco van de Voort
to Unknown author
Show quoted text 11 lines
> you know some pointers to information (I couldn't find the thing I was > trying to search for ...). > > So does someone know whether there is a library or system calls or whatever > which allow assignment of particular threads or processes to a specific > processor on an SMP machine ? Does not matter which language as long as it > can be used with FPC... I'm currently desperately looking at such stuff but > can't find a thing. :( I have SMP Linux, and as far as I know, you cannot influence the CPU a particular process/thread is running.

IIRC in 2.4 there will be a realtime queue. Putting the process in that queue might have that effect.

Reply by email

md
to Marco van de Voort

Marco is correct if you want realtime aspects considered.

But if you must lock down a single cpu, then you must edit/recompile/test/debug kernel source. That may be more of a burden that it is worth.

Better to use the realtime queue to approximate your scheduling needs with little debug than to
alter the scheduler for whatever it is you are seeking to do?

In a very abstract way, what are you trying to do that requires CPU lockdown?

Mark

Marco van de Voort wrote 19 lines
> > you know some pointers to information (I couldn't find the thing I was > > trying to search for ...). > > > > So does someone know whether there is a library or system calls or whatever > > which allow assignment of particular threads or processes to a specific > > processor on an SMP machine ? Does not matter which language as long as it > > can be used with FPC... I'm currently desperately looking at such stuff but > > can't find a thing. :( > > I have SMP Linux, and as far as I know, you cannot influence the CPU a particular > process/thread is running. IIRC in 2.4 there will be a realtime queue. Putting the process in that queue might have that effect. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email