sched_yield query

0 views
Skip to first unread message

manish(monu)

unread,
Apr 21, 2023, 1:24:56 PM4/21/23
to inside...@googlegroups.com
Hi,

1. If we have a loop running for 10s, we want to relinquish cpu after every 2 sec, will sched_yield help?
2. If the loop runs for 100 times, after every 20 iterations the loop has run, we put sched_yield(). will it continue from 21st iteration after it returns back from sched_yield()? or will it start from 1st iteration again?

Regards,
Manish

Anil Kumar Pugalia

unread,
Apr 22, 2023, 3:38:11 AM4/22/23
to inside...@googlegroups.com

1. Yes, it may.

2. From 21st iteration.

Regards
Anil
Passion: https://sysplay.in (Playing with Systems)
manish(monu) wrote on 21/04/23 10:54 pm:
--
You received this message because you are subscribed to the Google Groups "SysPlay's Inside Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inside_linux...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inside_linux/CAA4OrFn3_n0WydG_zDEzeJ28j-%3DceXRK1W1N_7juMhiKjTNi%3DA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages