Da, am inteles problema :). In implementarea mea asteptam confirmarea ca serverul a terminat scrierea, nu m-am gandit la ce se poate intampla in cazul in care nu se face asta. <br>Cred ca solutia 2 e mai buna, cred ca voi modifica si in enunt la un moment dat...
<br>Deci asteptati confirmarea de la server ca a terminat operatia pentru a evita race-ul asta.<br><br><br><div><span class="gmail_quote">On 12/19/06, <b class="gmail_sendername">Cristi B</b> <<a href="mailto:cristib84@yahoo.com">
cristib84@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sadica propunere, imi place :)<br><br>De fapt nu fragmentarea era de vina.
<br>Problema se putea reproduce f. ushor daca stergeam si fisierul<br>destinatie innainte sa dau comanda de scriere. Deci:<br><br> rm myfiles/input.txt; ./client <a href="http://127.0.0.1/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
127.0.0.1</a> wr myfiles/input.txt 0 1048576 < input.txt; diff input.txt myfiles/input.txt<br><br>Acum ca am putut reproduce problema mi-am dat si seama de<br>ce se intampla: pai dc clientul da comanda de scriere DUPA
<br>CARE IMEDIAT verifica dc fisierul este scris evident ca serverul nu apuca sa scrie tot, ptr ca el scrie cu "aio_write".<br><br>Acum solutia, asha cum vad eu, ar fi una din doua:<br><br>1) se modifica toate testele sa se dea un "sleep 1" dupa fiecare
<br> comanda de scriere(asta era practica la toate temele trecute)<br><br>2) fie modific clientul ca sa termine executia dupa ce serverul ii<br>confirma ca a
executat comanda(totusi o observatie in enuntul<br>temei nu ar strica in acesta privinta)<div><span class="e" id="q_10f9ae4cfd385170_1"><br><br><b><i><a href="mailto:cosminratiu@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
cosminratiu@gmail.com</a></i></b> wrote:<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Cred ca stiu ce e. E greu reproductibila problema, dar e cauzata de faptul ca in mod normal pe localhost nu se fragmenteaza pachetele trimise, dar uneori se poate intampla asta. Trebuie sa prinzi un caz din asta si sa analizezi logurile programului tau :).
<br>Good luck!<br><br><br><div><span class="gmail_quote">On 12/19/06, <b class="gmail_sendername">Cristi B</b> <<a href="mailto:cristib84@yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
cristib84@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> La mine testul 21 pica cam in 50% din cazuri.<br>Totusi nu reusesc sa reproduc problema manual, adica sa rulez eu din 2 shelluri:
<br>
./server<br>si<br> ./client <a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 127.0.0.1</a> wr myfiles/input.txt 0 1048576 < input.txt; diff input.txt myfiles/input.txt
<br><br>"input.txt" e generat cu programul ./generate.<br><br>Am rulat comanda de client de zeci de ori si nu crapa serverul nici nu imi zice ca difera fisierele. <br><br>In conditiile astea de ce imi zice ca pica testul 21 ?
<br><span><div> __________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br><a href="http://mail.yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.yahoo.com</a> </div></span><br>_______________________________________________<br>so mailing list<br><a href="mailto:so@cursuri.cs.pub.ro" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
so@cursuri.cs.pub.ro</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>
<br><br></blockquote></div><br> _______________________________________________<br>so mailing list<br><a href="mailto:so@cursuri.cs.pub.ro" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">so@cursuri.cs.pub.ro
</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br></blockquote><br><p>
__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br><a href="http://mail.yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.yahoo.com</a>
</p></span></div><br>_______________________________________________<br>so mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br><br><br></blockquote></div><br>