2010-03-16 05:00:17 sched_setscheduler usage
Ruud Althuizen (NETHERLANDS)
Message: 87245
Hello,
I was reading linux-kernel:smp-like (I have a BF561) and saw that in some cases you need to set cpu affinity. The problem is though that I couldn't figure out if I can combine this with vfork().
I would like to have one parent process that spawns a new process using vfork()/exec() on core 1 and do his own work (parent) on core 0. The problems resides in this statement (from above link): "all threads of a process are restricted to the same core".
1) Does that include programs started using vfork()/exec()? And if not: 2) when do I need to set the affinity?
QuoteReplyEditDelete
2010-03-16 06:31:57 Re: sched_setscheduler usage
Sonic Zhang (CHINA)
Message: 87250
vfork doesn't allow you to run parent and child concurrent. Let alone on different cores.
QuoteReplyEditDelete
2010-03-16 08:21:22 Re: sched_setscheduler usage
Ruud Althuizen (NETHERLANDS)
Message: 87255
vfork doesn't allow you to run parent and child concurrent. Let alone on different cores.
---
Hence the exec() to open a program as a new process. I think it all boils down to whether it is possible to set the affinity after a program is started (probably), and if there are any prerequisites to consider.
QuoteReplyEditDelete
2010-03-16 10:32:05 Re: sched_setscheduler usage
Mike Frysinger (UNITED STATES)
Message: 87265
there are no restrictions on affinity and when you set it
vfork/exec is not a thread, it's a new process
QuoteReplyEditDelete