Re: Writing code that takes time to run

2021-05-22 Thread Richi Dubey
*Sent:* Saturday, May 22, 2021 7:21 AM > *To:* Joel Sherrill > *Cc:* Sommer, Jan ; rtems-de...@rtems.org < > devel@rtems.org> > *Subject:* Re: Writing code that takes time to run > > > > Hi, > > > > About the code: > > > > T_busy(T_get_one_clock

RE: Writing code that takes time to run

2021-05-22 Thread Jan.Sommer
code that takes time to run Hi, About the code: T_busy(T_get_one_clock_tick_busy() * SOME_CONSTANT); does this support context switch? If task A executing on CPU 1 gets preempted while executing this (by task B) and then comes back on CPU 1 after some time (when task B finishes its execution

Re: Writing code that takes time to run

2021-05-21 Thread Richi Dubey
Hi, About the code: T_busy(T_get_one_clock_tick_busy() * SOME_CONSTANT); does this support context switch? If task A executing on CPU 1 gets preempted while executing this (by task B) and then comes back on CPU 1 after some time (when task B finishes its execution), would task A finish its exec

Re: Writing code that takes time to run

2021-05-20 Thread Richi Dubey
Hi, Thanks for your quick responses! The suggestion certainly is helpful, we are going to try it out. I'll post the result here. On Thu, May 20, 2021 at 8:57 PM Joel Sherrill wrote: > > > On Thu, May 20, 2021 at 10:05 AM wrote: > >> Hi Richi, >> >> >> >> You can checkout the T_busy functions

Re: Writing code that takes time to run

2021-05-20 Thread Joel Sherrill
On Thu, May 20, 2021 at 10:05 AM wrote: > Hi Richi, > > > > You can checkout the T_busy functions here: > https://git.rtems.org/rtems/tree/cpukit/include/rtems/test.h#n2390 > > uint_fast32_t T_get_one_clock_tick_busy(void) gives you the busy count > for one tick. > > > > You can then calculate th

RE: Writing code that takes time to run

2021-05-20 Thread Jan.Sommer
Hi Richi, You can checkout the T_busy functions here: https://git.rtems.org/rtems/tree/cpukit/include/rtems/test.h#n2390 uint_fast32_t T_get_one_clock_tick_busy(void) gives you the busy count for one tick. You can then calculate the number of cycles you need to wait for you desired certain tim

Re: Writing code that takes time to run

2021-05-20 Thread Joel Sherrill
On Thu, May 20, 2021 at 9:54 AM Richi Dubey wrote: > Hi, > > We are thinking of writing a piece of code that takes some time to run (it > would be amazing if it takes around 2 secs to run on hardware, but we would > be happy with something that takes a few milliseconds as well). > > We tried writ