Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #1471
| From | "io_x" <a@b.c.invalid> |
|---|---|
| Newsgroups | comp.programming, alt.lang.asm, comp.lang.c |
| References | (1 earlier) <4f83d522$0$1385$4fafbaef@reader2.news.tin.it> <4f83ef7f$0$1378$4fafbaef@reader2.news.tin.it> <4f83fbbd$0$1388$4fafbaef@reader2.news.tin.it> <4f8410cc$0$1389$4fafbaef@reader2.news.tin.it> <4f8907f6$0$1384$4fafbaef@reader1.news.tin.it> |
| Subject | Re: [Cross post: prog+asm+c]thread problem: one write, many read |
| Date | 2012-04-15 08:04 +0200 |
| Message-ID | <4f8a63e0$0$1383$4fafbaef@reader2.news.tin.it> (permalink) |
| Organization | TIN.IT (http://www.tin.it) |
Cross-posted to 3 groups.
"io_x" <a@b.c.invalid> ha scritto nel messaggio
news:4f8907f6$0$1384$4fafbaef@reader1.news.tin.it...
> /*
> thrRead(&w) w in 0..99
> Legge il buffer condiviso e lo scrive
> nella posizione p[w]
> */
> unsigned long __stdcall thrRead(void* w)
> {u32 i, j, a;
>
> if(w==0||*(u32*)w>99)
> {la: R -1;}
> a=waitLock(&m, &m1); if(a==-1) G la;
> blc(&v1); ++v; frs(&v1);
> frs(&m1);
> F(a=*(u32*)w, i=0; i<64 ; ++i)
> p[a][i]=buf[i];
> blc(&v1); --v; frs(&v1);
> R 0;
> }
unsigned long __stdcall thrRead(void* w)
{u32 i, j, a;
if(w==0||*(u32*)w>99)
{la: R -1;}
a=waitLock(&m, &m1); if(a==-1) G la;
++v;
frs(&m1);
F(a=*(u32*)w, i=0; i<64 ; ++i)
p[a][i]=buf[i];
blc(&v1); --v; frs(&v1);
R 0;
}
this seems goes ok...
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar
[Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-10 08:24 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-10 08:42 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-10 10:34 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-10 11:26 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-10 12:56 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-14 07:20 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-15 08:04 +0200
Re: [Cross post: prog+asm+c]thread problem: one write, many read "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-04-10 10:01 +0200
Re: thread problem: one write, many read "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-04-13 17:13 -0700
Re: thread problem: one write, many read "io_x" <a@b.c.invalid> - 2012-04-14 10:56 +0200
csiph-web