[so] sleep
Cosmin Arad
so@atlantis.cs.pub.ro
Sun, 30 Nov 2003 04:50:06 -0800 (PST)
te complici, foloseste nanosleep.
--- Mihai Iancu <mail2mihai@yahoo.com> wrote:
> la readerswriters e nepotrivit sleep-ul care
> face sleep doar secunde si astfel cu 30 de readers
> si
> 30 writers cand intra un writer si pana iese
> sigur mai vine un writer si astfel nu mai apuca nici
> un readers sa ma intre caci asteapta sa nu mai fie
> nici un wr ... stiti cu totii povestea.
>
> Vreau sa folosesc
> /**
> *face un sleep de sec si usec
> */
> int mysleep( int sec, int usec){
> struct timeval opt;
> opt.tv_sec = sec;
> opt.tv_usec = usec;
> return select(1,0,0,0,&opt);
> }
>
> nu cred ca e in POSIX
>
> e ok?
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree