2013/11/9 dw <limegreenso...@yahoo.com>

>        handle = CreateSemaphore(NULL, (LONG) value, (LONG) 1024, name);
>
>
> Why 1024?  Is this the same as SEM_VALUE_MAX?
>

Probably not the same. I'm now changing it to  SEM_VALUE_MAX.


>
>      if (handle == NULL){
>         LPTSTR buffer;
>         errno = EINVAL;
>         return (_sem_t *)SEM_FAILED;
>     }
>
>
> What's the "buffer" for?
>


Missed that on cleanup. It was there for debugging purposes but now is
useless.


>
>
>  static int _sem_timedwait(_sem_t *sem, const struct timespec
> *abs_timeout){
>     long milliseconds = abs_timeout->tv_sec * 1000;
>     milliseconds += (abs_timeout->tv_nsec/1000000);
>     tubo_sem_timeout(sem, milliseconds);
> }
>
>
> This doesn't appear to match the man 
> page<http://man7.org/linux/man-pages/man3/sem_wait.3.html>I read: "If the 
> timeout has already expired by the time of the call"
> implies that an absolute time is being specified, not a duration.  While I
> think your definition is more useful, this may result in unexpected
> behavior for others.
>

Right. An absolute time is better to keep things consistent. As soon as I
put in the code to support unnamed semaphores, I'll post the corrected code
to the list.

Thanks for your comments!



------------------------------------------------------------------------------------
Dr. Edscott Wilson Garcia
Applied Mathematics and Computing
Mexican Petroleum Institute
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to