[ECOS] pthread version of cyg_thread_delay
Thu Nov 13 14:57:00 GMT 2008
A quick google suggests that others have found 'select' as a possible
Another approach might be to use #define to for OS specific calls.
Then you can use similar functionality that is OS dependant.
> -----Original Message-----
> From: email@example.com [mailto:ecos-discuss-
> firstname.lastname@example.org] On Behalf Of Tyler Wilson
> Sent: Thursday, 13 November 2008 1:42 PM
> To: email@example.com
> Subject: [ECOS] pthread version of cyg_thread_delay
> In a previous thread I started here on the list, asking about the
> synthetic target, it was suggested a better approach might be to use
> POSIX threads compatibility layer in eCos, and write to that. This
> allow the application code to be the same for both eCos and Linux - and
> potentially Windows with pthreads-win32 (if it works).
> As a starting point I thought it would be useful to do a simple port of
> the 'twothreads' example to a POSIX threads version, which I call it
> 'twopthreads' - original, ugh.
> One item I have run in to, not being a pthreads expert, is what the
> POSIX equivilant of cyg_thread_delay might be. There is a pthread_yield
> type call, but there is no way to give it some time value, and have the
> system do the proper thing in the background.
> I have tried using nanosleep, but it results in some odd behavior -
> sort of SIGTRAP occurs when I use it. I have also tried to use
> cyg_thread_delay directly, but that did not work either.
> So, any examples or pointers to a pthread-friendly way to perform a
> delay within a thread function?
> Thank you,
> Before posting, please read the FAQ:
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss