Elliniko Sorting

keramida at ceid.upatras.gr keramida at ceid.upatras.gr
Fri Oct 23 16:27:10 EEST 1998


Some minutes ago I wrote:
% 
% . . .
%
%                                      . . . Ftiaxveis eva programma pou
% tajivomei me tov ASCII.  Meta allo programma pou pairvei to sorted arxeio
% kai to avadiatassei me kapoious dikous sou kavoves, ki eisai etoimos.
% 

Gia tnv avatajivomnsn twv lejewv:

Mia idea pou eixa priv apo liso (afou esteila to proigoumevo mail dustuxws)
eivai va ftiakseis duo processes pou epikoivwvouv mesa apo (24+26)*2 avoixta
file descriptors [to voumero twv file descriptors eivai kapos megalo, alla
gia ta movterva leitourgika sustnmata dev prepei va eivai kai problnma].

To prwto process diabazei apo to standard input tou to arxeio kai grafei sto
katallnlo file descriptor oln tnv grammn, dialegovtas to file descriptor me
basn to prwto gramma tns leksns.  Auto eivai olo...

To deutero process, diabazei me tn seira ta file-descriptors, kai grafei
sto standard output tou oles tis lekseis ka0e descriptor priv diabasei to
epomevo.  Etsi, av diabasei prwta oles tis lekseis tou descriptor [1]
(gia paradeigma) tote oles oi lekseis pou ksekivave apo `A' 0a graftouv
prwtes sto standard output, av meta diabasei to descriptor pou exei
avtistoixnsei sto ellnviko kefalaio `A', tote auto 0a graftei deutero,
kok. mexri va tou teleiwsouv ta descriptors.

Eivai kapws barbaro auto osov afora tnv xrnsn twv avoixtwv arxeiwv se
eva UNIX sustnma, kai mporei to kernel va avagkastei va krataei se
buffers gia ta avoixta descriptors polla dedomeva, alla n sxediasn
twv duo programmatwv eivai polu apln, kai tairiazei me tnv filosofia
tou UNIX [va spave ta programmata se mikra kommatia, avaloga me tnv
douleia pou prepei va kavouv].

Av de, avti gia duo processes xrnsimopoinseis duo threads...
Opws kai va 'xei, auto pou 0eleis givetai.  Ta upoloipa eivai mallov
0ema ulopoinsns :)

-- 
Georgios E. Keramidas (keramida at ceid.upatras.gr)
"In the name of the Father, the Son and the Linux-spirit."
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list