Click here to Skip to main content
16,011,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I hate to do this but, i just got one more question... Pin
Joaquín M López Muñoz6-Mar-02 3:04
Joaquín M López Muñoz6-Mar-02 3:04 
GeneralRe: I hate to do this but, i just got one more question... Pin
Christian Graus6-Mar-02 10:26
protectorChristian Graus6-Mar-02 10:26 
GeneralRe: I hate to do this but, i just got one more question... Pin
SilverShalkin6-Mar-02 12:11
SilverShalkin6-Mar-02 12:11 
GeneralRe: I hate to do this but, i just got one more question... Pin
Christian Graus6-Mar-02 21:13
protectorChristian Graus6-Mar-02 21:13 
Generaldamn CSocket ! Pin
Mauricio Ritter6-Mar-02 0:35
Mauricio Ritter6-Mar-02 0:35 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 0:46
sitebuilderNish Nishant6-Mar-02 0:46 
GeneralRe: damn CSocket ! Pin
Mauricio Ritter6-Mar-02 0:53
Mauricio Ritter6-Mar-02 0:53 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 1:34
sitebuilderNish Nishant6-Mar-02 1:34 
Mauricio Ritter wrote:
Why ? I´ve used MFC in other services I´ve developed and they´re working for years by now... without any problems. Do you have the link to the newsgrp ?

Here are some snips :-
As you can see he discourages even STL.
I think he knows enough of what he is talking about, to take this seriously...



You can't. Don't even waste time trying. Services should not use MFC, even for simple
structures like CString. Services should be written in C. Usage of C++, including but not
limited to MFC, is often fatal to services (you can't control the storage allocation, and
a service is expected to run for months; even slight storage fragmentation is fatal).
joe


Gosh Joe

This is bad news for me.
I was planning to convert a proxy server [http/smtp/pop3] into individual
services [each protocol proxy as a separate service]

And the original used only C and API.

This time I thought I'd use some MFC, primarily so that I could enjoy the
luxuries of CString.

Frown | :-( (((

Nish


In fact, the use of CString is one of the serious horrors that will impact reliability. A
service needs to have very precise storage management, and C++ (and worse still, MFC)
mitigate strongly against this. I used to write operating system services, many years ago,
and storage fragmentation was the single greatest problem we had. For example, I replaced
one system with an allocator that only allocated blocks that were multiples of 256 bytes,
and the change in service reliability was amazing. While the release version of CString
uses heavy quantization (64, 128, 256 and 512 byte strings, plus "bigger"), that is three
more quanta than are acceptable, and the "bigger" does not allocate in multiples of the
quantum. The result will eventually be a memory footprint that consumes all available swap
space. Note that using STL has the same problems. I've often said that code space is a
concept so completely irrelevant that it is not worth wasting time on. Data space, on the
other hand, can kill you. The real art in writing reliable system services is in managing
the data space *very* carefully.
joe



Nish

[Signature temporarily down]
GeneralRe: damn CSocket ! Pin
Tomasz Sowinski6-Mar-02 1:56
Tomasz Sowinski6-Mar-02 1:56 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 2:00
sitebuilderNish Nishant6-Mar-02 2:00 
GeneralRe: damn CSocket ! Pin
Tomasz Sowinski6-Mar-02 2:09
Tomasz Sowinski6-Mar-02 2:09 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 2:13
sitebuilderNish Nishant6-Mar-02 2:13 
GeneralRe: damn CSocket ! Pin
Mauricio Ritter6-Mar-02 2:00
Mauricio Ritter6-Mar-02 2:00 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 2:07
sitebuilderNish Nishant6-Mar-02 2:07 
GeneralRe: damn CSocket ! Pin
Mauricio Ritter6-Mar-02 3:36
Mauricio Ritter6-Mar-02 3:36 
GeneralRe: damn CSocket ! Pin
Christopher Duncan6-Mar-02 16:55
Christopher Duncan6-Mar-02 16:55 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 1:38
sitebuilderNish Nishant6-Mar-02 1:38 
GeneralRe: damn CSocket ! Pin
Mauricio Ritter6-Mar-02 1:59
Mauricio Ritter6-Mar-02 1:59 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 2:02
sitebuilderNish Nishant6-Mar-02 2:02 
GeneralRe: damn CSocket ! Pin
6-Mar-02 1:20
suss6-Mar-02 1:20 
GeneralRe: damn CSocket ! Pin
Nish Nishant6-Mar-02 1:36
sitebuilderNish Nishant6-Mar-02 1:36 
GeneralRe: damn CSocket ! Pin
6-Mar-02 2:39
suss6-Mar-02 2:39 
GeneralRe: damn CSocket ! Pin
6-Mar-02 1:03
suss6-Mar-02 1:03 
GeneralRe: damn CSocket ! Pin
Giles6-Mar-02 2:48
Giles6-Mar-02 2:48 
GeneralI am a chinese boy,give me a hand.thank you! Pin
big20025-Mar-02 23:59
big20025-Mar-02 23:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.