PDA

View Full Version : New core


darkone
01-22-2004, 01:10 PM
Once again, I decided to do a partitial rewrite. This time I'm moving all blocking/cpu dependant operations out of io threads.

The most expensive operation executed within io threads is QueueJob(), which executes ~300k times per second :)

Ps. I've already compiled a test version... so this won't take long :p

odd
01-22-2004, 01:34 PM
Sounds good alltho I dont understand much of it :)

ReCaR
01-22-2004, 01:39 PM
way to go !!!!!!!!!


(I think)

Thanks 4 spending so much time on ioFTPD D1, we really appreciate it !

NorLan
01-22-2004, 05:59 PM
hmmmm d1 if you say so much about how good the code is - i come to the conclusion to buy a source code license one day

and if it is just to stick sheets of the printed code all around in my flat *gg

mr_F_2
01-22-2004, 11:05 PM
sounds good to me, as long as it's improving and not degrading :D

_rage_ thegod
01-23-2004, 07:20 AM
way to go ;)

darkone
01-23-2004, 08:40 AM
Originally posted by NorLan
hmmmm d1 if you say so much about how good the code is - i come to the conclusion to buy a source code license one day

and if it is just to stick sheets of the printed code all around in my flat *gg

:p I've learned over time, that best way to write code is to use several layers and store variables inside structures.

Layers:

1st layer: VOID TransmitPackages(LPSOCKET lpSocket, LPIOBUFFER lpBuffer, DWORD dwBuffers, VOID (*lpCallBack)(LPVOID, DWORD), LPVOID lpContext);
2nd layer: TranmistPackages_Update(), TranmistPackage_xxx(), TranmistPackage_Timer() (where xxx = package type)
3rd layer: QueueJob(), StartIoTimer(), StopIoTimer(), ioSend(), ioRecv(), ioReadFile(), ioWriteFile(), ioCloseSocket(), Allocate(), Free()
4th layer: Windows API calls

For variables, I usually use structures:

typedef struct _SOCKET
{
SOCKET Socket;
} SOCKET, *LPSOCKET;

Also, bitwise flags are a must :) They allow adding extra parameters without need of rewrite any of the high-level code :)