Aight, so we need some macros to check the platform, maybe
rename LV_WIN32 to LV_OS_WIN32 and add extra macros
for other platforms ?
Duilio would you mind looking into this ?
Vitaly, it's better not avoid usleep btw because
of the wakeup ticks ?
Busy waiting is indeed not a good idea, how can we solve
this using threading Duilio ? (* note to self, I should
buy the pthreads book :))
Cheers,
Dennis
On Sun, 2004-09-05 at 17:26 -0300, Duilio Javier Protti wrote:
> > Not sure if select() will work correctly, probably not.
>
> select() will work right, but only on Linux :-(
>
> I will add this check on future, so usleep we will use
> select only on Linux systems.
>
> > To implement precise usleep() gettimeofday() should be used, imo.
>
> gettimeofday() can be used to get time, but the problem is
> how to wait until the time has elapsed. "Busy waiting" is not
> a good idea, and is the only option until we will get some
> other way to go to sleep (VisThread in future?). But select()
> does this sleep for us, and doesn't consume process CPU cycles.
>
> Regards,
> Duilio.
|