Saturday, March 25, 2006

Asynchronous I/O rocks.

I used to use poll() / select() to check if a filedescriptor
was ready for writing/reading, for reading i learnt something
new.. i didnt know nothing about AIO things, so i made some
tests with this asynchronous functions... aio_read , aio_write ,
aio_cancel , aio_suspend , etc.. and is very easy. aio in unix
uses pthreads to read() a FD and continue the execution
of the process (i mean aio functions return a value immediatly).
Its good to know this type of methods , at the beginning,
if i knew this thing two years ago something different would
happen in my life haha :p
im in a new project related to multiple sockets , i need to
code it and make it work in HP-UX and solaris so i need
to use strictly posix , and i didnt know nothing about AIO.
Another fun thing is that im 'touching' some features of 'hypercube'
webserver code from a good friend anakata
to run on sparc & hpux, anakata use this , thats why i wanted
to learn wtf was happening. maybe this is something i needed to
know, but i didnt.. so , maybe lot of you havent used this.

So here is an example i made to ALL OF YOU , commented,
and i hope i can start being a good programmer.
This examples reads the stdin, and it enters a while(1) { sleep(1); printf(); } loop
and when the buffer is read from stdin a signal is sent and
the program finishes. this can be useful for sockets , poll()
can handle multiple events like urgent packets etc..
but for a "standard" I/O async this is very useful.
remember im not a computologist, but i like lot this shit. hehe


Source here

Sunday, March 19, 2006

I just finished doing my database manager , i put the source in public on, a friend told me that i was wrong publishing my source there, that it would been better in a more specialized forum, i wanted critics (im not a computer scientist , neither a programmer , i'm studying to be a mathematician
so i spected technical critics not just crap like "Your code is a shit" , but well , what can i spect of the same script kiddies
that thinks they are hackers or hacktivists or whatever the fuck you want to call them.
but well , people there just say the same bullshit that everybody knows, but nobody applies

1) Need to indent the code
2) need to have a version control
3) need to comment all the source code
4) not to mix different styles of programming
5) compatibility

etc... and all the bullshit you 'learn' in a 'programming I' course in computer engineer.
everybody knows that , but nobody knows how to make a fucking hello world , how to use a processor, or
how to use special features of a processor like intruction pairing , or when to use malloc() and when to NOT use it
or how to use a nonblocking function for filedescriptors , or the difference of poll and select , etc..
in my point of view the code is secure and works fine , and if its not , well , the point of that is the algorithm , im not planning to use it for a root server, is just for me and is fast (hash tables are O(1) (fastest) or O(n) (slowest) ,
but well i dont care , i never said my source was an "innovation" but well people start saying bullshit like

"why you publish something that is not innovative"

i publish it because i want, and if is not innovaative , is the same thing as the useless thing GNOME (dirty code , slow as hell) and there are other better window managers, at the beginning i said that it was for 'educational purposes'
because , everybody knows what the fuck is a hash table , but nobody codes it in a serious way.

blah , is the same bullshit if i say "Why you use linux fucking fanatic" , and you dont use BSD , is the same thing"
(because in mexico 90% of the people who use linux, could make the same shit using a pirate windows XP)
they use it for being elite , or for anti-tech causes like fanatism , or opossition to monopoly's , i support monopoly's
in technology , technology must be standarized for being easier and have the same opportunities for everybody to exists in their life , i use linux , but i use it to test shit of my work to be portable...
but i preffer all the people using microsoft windows , solaris , irix or bsd and not a new crap that is made by thousands of morons like richard stallman thay they feel they are god , but they are nobody.
that tries to copy other unixes to appear like the monopoly's OSes like Novell with the desktop crap trying to be the same as cocoa , or gnome trying to be a Windows but 2000% slower and a fucking cocktail of libraries mapped in memory when displaying a stupid animation, and mmaping lot of megs of bullshit,
in my point of view, the software is being corrupted with lot of pseudo programmers and wannabe's in mexico,
you cant do anything because you get insulted, nobody does anything but they feel they can 'stupidize' the things other people does.
Mexico is a country of egos or whatever the fuck you want to call it , but the point is that people doesnt like to learn with others , and they cannot admit, there are people they could learn from,
linux is not an innovation , as my program , linux doesnt provide new algorithms, neither GNU , gcc is good , but is not an innovation , there are better compilers and better algorithms to parse the code and give more optimization,

Eduardo Ruiz Duarte