[so] [Tema2]Test 8 again
Bogdan Sass
bogdan.sass at catc.ro
Fri Apr 17 09:06:43 EEST 2009
Andrei Tra wrote:
> Salut,
> Observasem ca la mine rulau toate testele pe Windows bine, exceptand
> testul 8 care in cca. 1 data din 4, dadea eronat ( eroarea consta in
> max. 3 cuvinte care nu apareau in ordinea in care trebuie ). Am
> reverificat algoritmii si in final am ajuns la apelul Sleep(), astfel
> ca am facut o comparatie intre cat dureaza efectiv functia ( valoarea
> 'Actually slept' ) si cat "i s-a cerut sa dureze" ( valoarea
> 'requested') ( caz concret, pe testul 8 ). Cateva exemple din fisierul
> de log (timpii sunt exprimati in milisecunde ):
>
> Actually slept: 1875 ( requested: 1800 ) ( + 75 )
> Actually slept: 2203 ( requested: 2100 ) ( + 103 )
> Actually slept: 2312 ( requested: 2200 ) ( + 112 )
> Actually slept: 3140 ( requested: 3100 ) ( + 40 )
> Actually slept: 3406 ( requested: 3400 ) ( + 6 )
>
> Concluzia e ca timpul efectiv de asteptare poate diferi de cel
> solicitat intr-o plaja destul de larga, astfel ca ( presupun ) nu e
> imposibil sa mai apara unele neconcordante intre rezultatul corect al
> testului si cel furnizat de program (neconcordante mici insa), in
> "anumite" conditii de rulare.
> Ar mai putea cineva sa efectueze niste teste similare, in scop de
> verificare?
Eu am facut altfel - am banuit functia Sleep(), asa ca am trecut la
WaitableTimer. Fara ca totusi rezultatul sa se schimbe.
Am postat acum vreo 2 zile un fisier de logging (de pe ultima
varianta, cu WaitableTimer), care arata cam asa:
1-31350239:Sleeping for 50 ms;
1-31350289:sending command |a picasso| //La 289 primul client a
iesit din sleep, si trimite deja comanda spre server
1-31350289:Sleeping for 200 ms;
1-31350489:sending command |a philippine|
1-31350489:Sleeping for 200 ms;
1-31350689:sending command |a sofia|
2-31350299:sending command |a albertina| //In timp ce al doilea
client porneste abia la 299, 10ms mai tarziu
2-31350299:Sleeping for 200 ms;
2-31350499:sending command |a ashlee|
2-31350499:Sleeping for 200 ms;
2-31350699:sending command |a sharleen|
2-31350699:Sleeping for 200 ms;
2-31350900:sending command |a alisha|
Timpii sunt tot in ms, obtinuti cu GetTickCount(). In cazul meu,
timpii de somn par buni, doar ca se termina cele 50ms inainte sa plece
al doilea proces :)
--
Bogdan Sass
CCAI,CCSP,JNCIA-ER,CCIE #22221 (RS)
Information Systems Security Professional
"Curiosity was framed - ignorance killed the cat"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090417/a67bc292/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3287 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090417/a67bc292/attachment.bin>
More information about the so
mailing list