[so] postare de cod
George Ciobanu
so@atlantis.cs.pub.ro
Tue, 27 Apr 2004 01:56:58 -0700 (PDT)
--0-794799190-1083056218=:9325
Content-Type: text/plain; charset=us-ascii
Postarea de cod pe forum nu este binevenita. Nu voi mai raspunde oricum la nici un mail cu intrebari de genul asta (de ce nu-mi merge codul ? ).
George
George Ciobanu <cdangeorge@yahoo.com> wrote:
Salut,
Folosesti intrari nenule pentru aio_suspend care nu au sens (dupa ce le-ai alocat ele devin nenule si atunci cand aio_suspend le testeaza nu le ignora si incearca sa le foloseasca)
George
Alex <alexzbant@yahoo.com> wrote:
imi da o eroare ori segmentation error cand pornesc programul ori invalid file descriptor dupa ceva timp ceva de genul asta...
..
..
..
struct aiocb *suspend_list[MAX_AIO_SUSPEND];
int fd[MAX_AIO_SUSPEND];
for (i=0;i<MAX_AIO_SUSPEND;i++)
{
if((suspend_list[i]=malloc(sizeof (struct aiocb))) ==NULL)
DieWithError("Esuare alocare()");;
}
..
..
..
void Thread2()
{
..
..
/////execut operatia asyncrona
while(1)
{
printf("deschid fd j=%d\n",fd[j]);
fd[j]=open(t_fis,O_CREAT,0666);
suspend_list[j]->aio_offset=t_of;
suspend_list[j]->aio_buf=Buffer;
suspend_list[j]->aio_nbytes=strlen(Buffer);
suspend_list[j]->aio_fildes = fd[j];
aio_read(suspend_list[j]);
aio_suspend( (const struct aiocb**) suspend_list,1,&timeout);
}
....
...
..
/////end operatia
si vroiam sa stiu daca ati receptionat tema 1 ca eu am trimis de f mult timp , si e tot 0, macar un "x" ca este primita
multumesc
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
--0-794799190-1083056218=:9325
Content-Type: text/html; charset=us-ascii
<DIV>Postarea de cod pe forum nu este binevenita. Nu voi mai raspunde oricum la nici un mail cu intrebari de genul asta (de ce nu-mi merge codul ? ).</DIV>
<DIV> </DIV>
<DIV>George<BR><BR><B><I>George Ciobanu <cdangeorge@yahoo.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV>Salut,</DIV>
<DIV> </DIV>
<DIV>Folosesti intrari nenule pentru aio_suspend care nu au sens (dupa ce le-ai alocat ele devin nenule si atunci cand aio_suspend le testeaza nu le ignora si incearca sa le foloseasca)</DIV>
<DIV> </DIV>
<DIV>George<BR><BR><B><I>Alex <alexzbant@yahoo.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV>imi da o eroare ori segmentation error cand pornesc programul ori invalid file descriptor dupa ceva timp ceva de genul asta...</DIV>
<DIV>..<BR>..<BR>..</DIV>
<DIV>struct aiocb *suspend_list[MAX_AIO_SUSPEND];<BR>int fd[MAX_AIO_SUSPEND];</DIV>
<DIV><BR>for (i=0;i<MAX_AIO_SUSPEND;i++) <BR>{<BR> if((suspend_list[i]=malloc(sizeof (struct aiocb))) ==NULL) <BR> DieWithError("Esuare alocare()");;<BR>}</DIV>
<DIV>..<BR>..<BR>..<BR>void Thread2()<BR>{<BR>..<BR>..<BR>/////execut operatia asyncrona</DIV>
<DIV>while(1)<BR> {<BR> printf("deschid fd j=%d\n",fd[j]);<BR> fd[j]=open(t_fis,O_CREAT,0666);<BR> suspend_list[j]->aio_offset=t_of;<BR> suspend_list[j]->aio_buf=Buffer;<BR> suspend_list[j]->aio_nbytes=strlen(Buffer);<BR> suspend_list[j]->aio_fildes = fd[j];<BR> aio_read(suspend_list[j]);<BR> <BR> aio_suspend( (const struct aiocb**) suspend_list,1,&timeout);<BR> <BR> }<BR> ....</DIV>
<DIV>...</DIV>
<DIV>..<BR> <BR>/////end operatia<BR></DIV>
<DIV> </DIV>
<DIV>si vroiam sa stiu daca ati receptionat tema 1 ca eu am trimis de f mult timp , si e tot 0, macar un "x" ca este primita </DIV>
<P><IMG src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/26.gif"></P>
<P> </P>
<P>multumesc</P>
<P>
<HR SIZE=1>
<FONT face=arial size=-1>Do you Yahoo!?<BR><A href="http://pa.yahoo.com/*http://us.rd.yahoo.com/hotjobs/hotjobs_mail_signature_footer_textlink/evt=23983/*http://hotjobs.sweepstakes.yahoo.com/careermakeover">Win a $20,000 Career Makeover at Yahoo! HotJobs </A></BLOCKQUOTE></FONT>
<P>
<HR SIZE=1>
<FONT face=arial size=-1>Do you Yahoo!?<BR><A href="http://pa.yahoo.com/*http://us.rd.yahoo.com/hotjobs/hotjobs_mail_signature_footer_textlink/evt=23983/*http://hotjobs.sweepstakes.yahoo.com/careermakeover">Win a $20,000 Career Makeover at Yahoo! HotJobs </A></BLOCKQUOTE></FONT><p>
<hr size=1><font face=arial size=-1>Do you Yahoo!?<br><a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/hotjobs/hotjobs_mail_signature_footer_textlink/evt=23983/*http://hotjobs.sweepstakes.yahoo.com/careermakeover">Win a $20,000 Career Makeover at Yahoo! HotJobs </a>
--0-794799190-1083056218=:9325--