REQ: Help on server testing

V13 v13 at priest.com
Fri Aug 30 16:39:01 EEST 2002


On Friday 30 August 2002 16:34, Antonis Kanavouras wrote:
> Koita pws to skeftomai:
>
> -To multiplexing to analamvanei ex oloklhrou h main thread
> - O user A dinei kapoio input
> - Me to pou pairnei ampariza (apo thn poll()) h socket tou A xekinaei mia
> thread me xamhloterh priority
>   pou kanei process o,ti edwse o A. Meta enhmerwnei thn main thread gia tis
> apofaseis ths
> - Sto metaxy h main thread einai eley8erh na dextei input apo ton user
> B,C,D klp
>
> To idio senario isxyei kai otan o server prepei na steilei response ston A
> -Xekinaei mia 8nhsigenh thread pou molis steilei o,ti einai na steilei
> pe8ainei kai sto metaxy h main thread
>  mporei na kanei alles douleies.
>
> Den xerw an ayto einai kerdos se ena mhxanhma me 1 epexergasth alla se SMP
> fantazomai oti exei nohma
> (xwris na eimai sigouros)

Oxi... Gia kathe write skopeveis na ftiaxneis neo thread to opoio na psofaei ?
Gia na stilei diladi 1K se komatia tvn 10bytes tha ftiakseis 100 threads? 

O kathe client exei toys dikoys toy I/O buffers. 
H diadikasi einai:

init();
while (1)
	main_loop();

opoy main_loop():

select()/poll()
analogos me ta apotelesmata toys:
do_reads() - check_input_buffers()
do_writes()

to do_reads diabazei apo kathe socket poy exei data symfvna me ta results tis 
select/poll kai ta bazei se enan input buffer. 

Sthn synexeia kaleitai h check_input_buffers h opoia psaxnei gia oloklires 
grammes stoys input buffers kai tis epeksergazetai katallila. Kalo einai ayto 
na syniparxei me to proigoyme stadio oste molis diabazeis dedomena apo ena 
socket na koitas amesvs gia oloklires grammes kai na min prepei na ta 
saroseis ola mazi sto telos.

Otan thes na grapseis kati kaleis tin write_to_client_buf() h opoia den grafei 
tipota sto socket kai apla bazei ta dedomena poy theleis na stileis ston 
katallilo output buffer.

Afoy teleioseis me ola ta sockets poy eixan data gia diabasma kaleis tin 
do_writes h opoia symfvna me ta apotelesmata ths select/poll grafei se osa 
sockets itan diathesima osa data mporei kai ta sbinei apo toys buffers...
Oti apomenei tha grafei molis ta sockets ayta ksanaginoyn etoima gia grapsimo,
se epomeno kyklo ths main_loop diladi.

k.o.k.

-- Ta onomata ton synartiseon einai tyxaia ektos apo tis poll/select

> Antonis
<<V13>>




More information about the Linux-greek-users mailing list