manospits / bulletin-boards Goto Github PK
View Code? Open in Web Editor NEWA bulletin boards implementation using pipes and signals
A bulletin boards implementation using pipes and signals
AM :1115201300143 ONOMA :Manwlhs Pitsikalhs To programma kanei oti zhthtai sthn ekfwnhsh opws kai to bash script pou zhthjhke kefalida mhnymatwn: --H epoikinwnia metaxu olwn twn diergasiwn ginetai me mhnymata ta opoia eqoun thn exhs morfh [sizeof(char)*10 :headersize][ header ][ mhnyma ] h kefalida arqika perieqei duo qarakthres gia na deixei to tupo tou aithmatos ka mporei na perieqei plhrofories opws to megejos tou mhnumatos ton tupo tou aithmatoston arijmo tou mhnumatos an prokeitai gia apostolh dedwmenwn pou den mporoun na graftoun mono me mia fora sto fifo ,to pid mias boardpost gia na xeqwrizontai ta mhnymata apo ton board_server se periptwsh pou qreiazontai polles fores read board: To programma board analambanei ton elegqo leitourgias tou board_server se periptwshh pou den treqei tote kanei fork() kai exec to programma board_server. Meta kanei sleep(1) etsi wste na eqei exasfalistei h dhmiourgia twn pipes apo ton server kai anoigei thn write pleura tou fifo self_r, anoigei thn read pleura tou fifo self_w Stelnei mhnyma ston server me oti treqei diergasia board kai o server anoigei thn write tou fifo self_w. Meta afou eqoun ginei oi katalhlles arqikopoihseis to programma board mpanei se epanalhyh opou perimenei na diabasei tis antistoiqes entoles.An h entolh einai h exit Stelnei mhnuma ston server oti kleinei to programma board kai o server kleinei thn write pleura tou fifo self_w board_server: Analambanei thn dhmiourgia twn fifo kai enos arqeio me onoma _spid to opoio perieqei to pid tou server kai qrhsimopoieitai gia ton elegxo ths leitourgias tou. Ta self_r kai ta others_r fifo ta anoigei se RDWR mode kajws qrhsimopoieitai gia thn axiopisth leitourgikothta ths select sto sugkekrimeno programma. Sugkekrimena otan h write pleura enos fifo einai kleistei h eqei qleisei h select anagnwrizei to fifo ws ready opws leei kai sto man ths select "Three independent sets of file descriptors are watched. Those listed in readfds will be watched to see if characters become available for reading (more precisely, to see if a read will not block; in particular, a file descriptor is also ready on end-of-file)" etsi gia na uparqei panta mia anoiqth write pleura anoigetai s auto to mode. Meta apo auta mpainei se ena loop kai perimenei na xemplokarei h select etsi wste na diabasei mhnymata apo ta fifos gia thn litourgikothta twn getmessages list send se periptwsh pou to mhnuma einai megalutero apo to epitrepto (512) ginontai pollapla write me antistoiqes kefalides gia thn apofugh lajwn logo ths eleipshs sugqronismou. boardpost: xekinaei kanei elegqo leitourgias tou server an treqei tote sunexizei thn ektelesh alliws kleinei me lajous. Sthn periptwsh pou douleuei anoigei thn write pleura kai stelnei mhnyma ston server oti ena boardpost treqei o server lambanei to mhnuma kai auxanei ton arijmo twn boardpost an autos htan 0 anogei thn write pleura tou fifo others_w alliws einai hdh anoiqth opote den qreiazetai kapoia drash. Meta mpainei se mia epanalhyh opou perimenei entoles apo ton qrhsth. An h entolh einai h exit tote stelnei mhnuma ston server oti kleinei ena boardpost opote kai o server meiwnei ton arijmo twn boardpost an ginei 0 tote kleinei thn others_w pleura. PARADOQES: -to programma board prepei na kleijei me path to opoio teleiwnei se / -epipleon an to path einai lajos epelexa na mhn ftiaqnei tous fakelous pou apaitountai mias kai einai eujhnh tou qrhsth na dwsei swsto path kai oqi tou programmatos na dhmiourghsei lajos fakelous p.q. dinei ./board /home/manos/documents/board kai einai lajos enw to swsto einai ./board /home/manos/Documents/board kati tetoio dhmiourgei askopa fakelo logw enos mikrou lajous. wstoso an auto htan aparaithto mporei na ginei eukola me strtok gia ta onomata kai klhseis mkdir -Upojetw oti ta mhnumta pou stelnontai me write <id> <mhnuma> mporoun na staloun me ena write wstoso o server uposthrizei lhyh mhnumatwn megaluterou megejous.!!!! PROSOQH!!!!!! arqeia kai entoles opws getmessages k list mporoun na ginoun me pollapla write kai upsthrizontai
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.