From: Joseph M. Newcomer on
You mean that after all these years you have never visited my site? I know I've given
citations to it before, and it doesn't take a profoundly deep set of neural responses to
go visit my Web site, that appears in my sig block on every messsage I post!
joe

On Thu, 25 Mar 2010 09:50:45 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
>message news:r3pmq51rukj4j28ed9es0ob84ejblp7bpb(a)4ax.com...
>> See below...
>> On Wed, 24 Mar 2010 23:10:47 -0500, "Peter Olcott"
>> <NoSpam(a)OCR4Screen.com> wrote:
>>
>>>
>>>"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
>>>message news:dlnlq5pok9nbsc35uaedbot0m18btno5ti(a)4ax.com...
>>>>A multithreaded FIFO queue would make more sense; less
>>>>chance of priority inversion
>>>> effects. An I/O Completion Port makes a wonderful
>>>> multithreaded FIFO queue with
>>>> practically no effort!
>>>> joe
>>>
>>>How ?
>> As I told you a few days ago, read my essay on the use of
>> I/O Completion Ports on my MVP
>> Tips site.
>
>No you didn't. As you can see from what you said immediately
>above, you did not tell me where to find them.
>
>>
>> Of course, if I told you that GetQueuedCompletionStatus is
>> the dequeue operation,
>> PostQueuedCompletionStatus the enqueue operation, it
>> should be completely obvious how to
>> do it. Or you could have gone to I/O Completion Ports in
>> the MSDN documentation and read
>> about the API calls and derived this information because
>> it is so triviial to see it.
>> here's an enqueue operation, and a dequeue operation.
>> What more do you need to see?
>> joe
>
>Fault tolerance.
>
>> ****
>> Joseph M. Newcomer [MVP]
>> email: newcomer(a)flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
See below...
On Thu, 25 Mar 2010 09:18:32 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Hector Santos" <sant9442(a)nospam.gmail.com> wrote in message
>news:OOcyQDBzKHA.5288(a)TK2MSFTNGP05.phx.gbl...
>> Peter Olcott wrote:
>>
>>> "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in
>>
>>>> A multithreaded FIFO queue would make more sense; less
>>>> chance of priority inversion
>>>> effects. An I/O Completion Port makes a wonderful
>>>> multithreaded FIFO queue with
>>>> practically no effort!
>>>> joe
>>>
>>> How ?
>>
>> Well, there will be programming effort with IOCP, his main
>> point is that you don't understand enough programming
>> ideas under Windows that you behaving here like a new kid
>> who just discovered the toaster oven and you don't want
>> follow others cooks or read a cook book in the many ways
>> to use the toaster oven.
>>
>> Look, your SOCKET is a FIFO. Its inherent. So when
>> connects come in, they are queued, designed for
>> multi-threaded worker pool concepts to handle the incoming
>> request.
>>
>> So what you do?
>>
>> You don't use threads, and you slow it down by adding
>> ANOTHER FIFO queue to run the OCR per request one at a
>> time.
>>
>> But now you think, I got a MONSTER machine. Its easier for
>> me to use create a EXE with MONGOOSE+OCR and run it 4
>> times, assuming it will be 1 EXE per multi-core processor.
>
>No you have this wrong. For proving that multiple threads
>would work multiple processes sufficed. In practice I will
>use multiple threads.
****
No, it doesn't. And if it is not obvious to you why this is true, you are being more
obtuse than any human being has the right to be. Or, as I've said before, denser than
depleted uranium. Perhaps you do not understand the difference between thread scheduling
within a process and scheduling thread when the process context changes. Perhaps you do
not understand how computers work, and that's why you are asking questions, and those of
us who KNOW what is going are desperately trying to explain to you that your experiment is
so deeply flawed as to be irrelevant, and WHAT PART OF THAT DO YOU FAIL TO UNDERSTAND? You
are comparing incomparable experiments, and your resistance to running the correct
experiment is truly impressive for someone who has already proven himself to be totally
clueless. I even tried to explain that the experiments are incomparable, but gee, that's
based on my understanding of the operating system and the x86 chip, and what the context
swap code is known to do when swapping process contexts (do you know what the implications
of "TLB Flush" are on your performance?) Maybe my tendency to read documentation biases
me, and you have no such biases.
joe
****
>
>>
>> Now you screwed up MONGOOSE, now you have 4 competition
>> SOCKET servers on PORT 80 and thats not possible on a
>> single machine. You can only have 1 PORT 80 HTTP
>> SERVICE - NOT FOUR!!
>>
>> So you automatically BLOCKED three of the EXE running in
>> memory, they will NEVER see a socket connection.
>>
>> But you say ok, "then I have no choice but to use FOUR
>> machines or even TWO for now."
>>
>> Now you need a LOAD BALANCER or just use simple round
>> robin logic in DNS records by adding two A records into
>> your ZONE for the same domain.
>>
>> myservice.com
>> 1.2.3.4 // machine 1
>> 1.2.3.5 // machine 2
>>
>>
>> Under DNS, it will round robin the IP to connect to. No
>> real concept for load balancing.
>>
>> The only load balancing concept you have is a FIFO at the
>> OCR part.
>>
>> So it all goes back to the Toaster Oven. You don't know
>> how to use the simply toaster oven and you don't want to
>> listen to anyone that what YOU are doing is freaking crazy
>> and you don't even realize that YOU can't do what you want
>> anyway with EXE per request when a socket is involved
>> without going into the need to add a LOAD BALANCING for
>> multiple machines.
>>
>> Really Peter, it skipped my mind that YOU can't run
>> multiple EXE when you have a socket service embedded into
>> it. But I said it in so many other ways, you are trying
>> to add a multi-threaded web server into 1 single thread
>> OCR process, when you should be adding a multi-thread OCR
>> process into a multi-thread service.
>>
>> It just dawned on me, that YOU can not do multiple
>> MONGOOSE+OCR EXE processors - mongoose is restricted to a
>> SINGLE PORT and you can't not have multiple services on
>> the same port on the same machine.
>>
>> --
>> HLS
>
>I will have some sort of web server that communicates with
>my OCR process using some sort of inter process
>communication. The web server will have multiple threads
>(probably pthreads) and the OCR process will have one thread
>per CPU core, probably also pthreads. These threads will
>share a single block of memory, one way or another.
****
Ah, the "handwave" school of design. "We can solve any problem by postulating the
existence of some magical mechanism that solves that problem". Sorry, I've been a
software manager, and if one of my people came to me with a proposal as p-baked as yours
(for, I'm beginning to realize, p << 0.05, so more than an order of magnitude below
"half-baked") I would send them back with instructions to GET THE RELEVANT DATA and HAVE A
CONCRETE PROPOSAL WITH PERFORMANCE NUMBERS to justify the design. You just plan to have
"some sort" of web server with "some sort" of interprocess communication. In what fantasy
world does this constitute "design"? It isn't even CLOSE to what is required in this
profession. And I've already told you that your concept of a single-threaded OCR process
is a losing idea, but you refuse to make any effort to gather any data to either support
or refute this idea, just insist that it must be correct. I suppose it constitutes "some
sort" of performance measurement. I have NO IDEA if a multithreaded OCR process will work
better, but the difference is that I WOULD GET THE DATA TO SUPPORT OR REFUTE THE DESIGN
PROPOSAL, and you plan to just blunder ahead without any data and build something, using
"some sort" of design methodology.

Maybe because I've already done this with my people that I know what the standards are, I
had to go to senior management and there was NO WAY I would have done this if someone said
"we're going to have 'some sort' of solution". Ultimately I had to do the performance
analysis myself because the people who worked for me were not qualified to do it, and kept
coming up with nonsense numbers that had no credibility (I ultimately proved all the
experiments flawed, and why, because they kept insisting I was asking for something that
could not be done; I did it myself in under four hours, proving that (a) it could be done
and (b) wasn't even very hard, which is what I'd been saying for a week And to do it in 4
hours, I was doing it on an operating system I'd never programmed before, using APIs I
only suspected existed, in a language I had not used, and a development environment I was
unfamiliar with)

You are going to have to come up with a better proposal than one that uses the words "some
sort" in it.
joe

>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
Well, I know the answer, and I think you are behaving in yet another clueless fashion. And
in my earlier reply I told you why. You want "fault tolerance" without even understanding
what that means, and choosing an implementation whose fundamental approach to fault
tolerance (synchonrous commit to disk) contradicts your requirement that there be no disk
access. in fact, you explicitly said you could not imagine why MySQL could require
hitting the disk if the database were small. Wel, I am not responsible for your lack of
imagination, nor for your failure to understand reality. I cannot figure out how you get
a concept like "disk access is unacceptable" to coexist with "fault tolerance is
essential" and "MySQL is the only possible interprocess communication system". Those of
us who have worked with databases know that the fault tolerance comes at a cost.

TANSTAAFL.
joe

On Thu, 25 Mar 2010 14:22:30 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Hector Santos" <sant9442(a)nospam.gmail.com> wrote in message
>news:%234edFDDzKHA.4492(a)TK2MSFTNGP05.phx.gbl...
>> Peter Olcott wrote:
>>
>>
>>> The whole process has to be as fault tolerant as
>>> possible, and fault tolerance requires some sort of
>>> persistent storage.
>>
>> There you go again, you read a new buzz word and now you
>> are fixated with it and further add to you NEVER finishing
>> this vapor ware product and project anyway.
>>
>> --
>> HLS
>
>That is the sort of response that I would expect from
>someone that did not know the answer.
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
See below...
On Fri, 26 Mar 2010 09:55:54 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Oliver Regenfelder" <oliver.regenfelder(a)gmx.at> wrote in
>message news:e148c$4bac7685$547743c7$23272(a)news.inode.at...
>> Hello,
>>
>> Peter Olcott wrote:
>>> I don't know. It does not yet seem worth the learning
>>> curve cost. The process is intended to be always running
>>> and loaded with data.
>>
>> I would say using memory mapped files with e.g. boost is
>> not
>> that steep a learning curve.
>>
>> Best regards,
>>
>> Oliver
>
>If we are talking on the order of one day to become an
>expert on this, and it substantially reduces my data load
>times, it may be worth looking into. I am still convinced
>that it is totally useless for optimizing page faults for my
>app because I am still totally convinced the preventing page
>faults is a far better idea than making them fast. Locking
>pages into memory will be my approach, or whatever the
>precise terminology is.
***
And your ****opinion*** about what is going to happen to your page fault budget is
meaningless noise because you have NO DATA to tell you ANYTHING! You have ASSUMED that a
MMF is going to "increase" your page faults, with NO EVIDENCE to support this ridiculous
position. At the very worst, you will get THE SAME NUMBER of page faults, and in the best
case you will have FEWER page faults. But go ahead, assume your fantasy is correct, and
lose out on optimizations you could have. You are fixated on erroneous premises, which
the rest of us know are erroneous, and you refuse to learn anything that might prove your
fantasy is flawed.
joe
****
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
See below...
On Mon, 22 Mar 2010 20:39:47 -0500, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>
>"Hector Santos" <sant9442(a)nospam.gmail.com> wrote in message
>news:OXYJ1RiyKHA.928(a)TK2MSFTNGP05.phx.gbl...
>>
>> Peter Olcott wrote:
>>
>>>>> Which is it (1) or (2) ??? Any hem hawing will be
>>>>> taken as intentional deceit
>>>>
>>>> None of the above:
>>>>
>>>> Your process AT THAT MOMENT does not need PAGE
>>
>> >> anything because it was already in your WORKING SET.
>>
>>>>
>>>> Look, YOU SIMPLE PROGRAM IS ALWAYS USING VIRTUALIZE
>>>> MEMORY! ALWAYS!
>>>
>>> You just contradicted yourself, but, there was no
>>> intentional deceit.
>>> (1) It is ALWAYS using virtual memory
>>> (2) There was an instance where is was not using virtual
>>> memory
>>
>>
>> I don't see that as a contradiction at all. Your process
>> gets 4GB Virtual Memory. There was a moment in space and
>> time that your program did not need the OS to page data
>> into your WORKING SET which is the virtual memory in
>> active use by your program.
>
>It was not a moment in time it was a 12 hour time period.
>The only reason that It ended was that I was convinced that
>twelve hours was enough.
>
>>
>> For example, program has allocated 2GB. It may look like
>> your program has access to 2GB and thats the overall idea,
>> but its virtualized. When you reference something in the
>> 2GB that is not in the WORKING SET, then you get a PAGE
>> FAULT which tells the system to go get from the page.sys
>> file the data you need.
>>
>> Look it says it right here in MSDN:
>>
>> http://support.microsoft.com/kb/555223
>>
>> In modern operating systems, including Windows,
>> application
>> programs and many system processes *ALWAYS* reference
>> memory using
>> virtual memory addresses which are automatically
>> translated to real
>> (RAM) addresses by the hardware. Only core parts of
>> the operating
>> system kernel bypass this address translation and use
>> real memory
>> addresses directly.
>>
>> Virtual Memory is always in use, *EVEN* when the memory
>> required
>> by all running processes does not exceed the amount of
>> RAM
>> installed on the system.
>>
>> REPEAT THE FIRST SENTENCE IN EACH PARAGRAPH 1000 TIMES!
>>
>> How ignorance can you be? When did you start using
>> Windows? or program for it?
>>
>> --
>> HLS
>
>For all practical purposes virtual memory is not being used
>(meaning that its use is not impacting performance) whenever
>zero or very few page faults are occurring.
>
****
And what part of VIRTUAL MEMORY IS ALWAYS BEING USED did you fail to comprehend? What
part of "virtual memory" != "paging activity" did you fail to comprehend? You can't even
use the vocabulary correctly AFTER we have told you are clueless and have told you the
correct language to use!
joe
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm