Hi --
--- In "denx_ts" <> wrote:
>
> Hi All!
>
> I'm developing a complex system based on TS-7250 SBC. The program is written
> in gnu c (by myself). I have 5 threads in the system and I recognize a
> strange influence between thees. When my serial communication thread works -
> I mean it communicates with an external peripheral - the usleep() function
> getting extremely fast in another (the main) thread. I know the resolution of
> the usleep() is 10 ms, but I use it with 2.0-5.0 sec timings, but more
> precisely than a sec.
>
> The strangest part of the situation is the faster behavior of usleep()
> instead of slower. I mean I could imagine that the usleep() is getting slower
> because of high load, but I don't understand how can it be faster than
> normal! (Actually the system isn't at high load, it was just an idea.)
>
> Any suggestions is appreciated!
On an early wakeup, check the error code to see if it was woken by a signal.
You could also try nanosleep instead of usleep.
What kernel, and what threading library?
regards, ......... Charlie
>
> BR:
> denx
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|