Re: Why is my overlapped WriteFile getting blocked? (repost)
From: Old Fart (OldFart_at_newsgroups.nospam)
Date: 06/19/04
- Previous message: PC: "Re: Winsock application connect fails at system startup (WSAENETUNREAC"
- In reply to: Rhett Gong [MSFT]: "Re: Why is my overlapped WriteFile getting blocked? (repost)"
- Next in thread: Yan-Hong Huang[MSFT]: "Re: Why is my overlapped WriteFile getting blocked? (repost)"
- Reply: Yan-Hong Huang[MSFT]: "Re: Why is my overlapped WriteFile getting blocked? (repost)"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Jun 2004 22:18:40 -0700
I don't know if you are purposely missing the whole point of this discussion
or if you really don't understand what I'm complaining about.
Perhaps you don't understand what I mean when I say the WriteFile is
"blocked". I don't mean that it is not completing. I do mean that
WriteFile is not returning (so I can go on and do other things) until the
write has actually completed, which in the case of a wait-mode named pipe
means that the peer has actually read the data. Overlapped WriteFile calls
should return (nearly) immediately, regardless of whether or not the write
has actually completed. That is not happening in this case.
As I've explained twice before, I have narrowed the problem down a bit. If
the client opens the named pipe using "." as the server name, the WriteFile
calls return immediately, as expected, whether or not the write operation
has actually completed. If the client opens the named pipe using a server
name, even if the server name happens to be the same machine as the client
is running on, then the WriteFile calls do not return until the write
operation is completed. This is not the way overlapped I/O should work! It
sure looks like a named pipe bug to me.
Please, give me some clue that you have even a vague understanding of what I
am trying to say. This whole discussion reminds me of an old joke:
A pilot is flying a helicopter in Washington state. He gets lost. He sees
a building with someone standing on the roof and yells to him, "Where am I?"
The person answers, "You're in a helicopter hovering above our building."
The pilot says "Thank you" and immediately heads for Sea-Tac. A passenger
asks the pilot, "How did you know where we were from that answer?" The
pilot responds, "Well, the answer was 100% correct and utterly useless. I
knew we must be at Microsoft's technical support center."
"Rhett Gong [MSFT]" <v-raygon@online.microsoft.com> wrote in message
news:HqdByXOVEHA.2764@cpmsftngxa10.phx.gbl...
> ;-) since you add 5s sleep in the server read thread, then ---
> When client writefile, your server read thread enter into sleep, so you
have no thread
> in server for the read transaction, the file will be written to cache and
no error
> returned to the client.
> I get following debug log for this scenario
> >Client --- Enter WriteFile
> >Client --- WriteFile immediately returned with error 0x0
> >Server -- Enter Sleep
> >Server -- ReadFile IO Pending
> However, if the sleep is over and you are writting file at just time, then
997 is
> returned as expected.
>
> From the log, you can see the sleep does not help anything but messes up
our program.
> So I suggest you removing this sleep and try dealing with read pending by
yourself.
> Thanks.
>
>
> Have a nice day!
> Rhett Gong [MSFT]
> Microsoft Online Partner Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Please reply to newsgroups only. Thanks.
>
- Previous message: PC: "Re: Winsock application connect fails at system startup (WSAENETUNREAC"
- In reply to: Rhett Gong [MSFT]: "Re: Why is my overlapped WriteFile getting blocked? (repost)"
- Next in thread: Yan-Hong Huang[MSFT]: "Re: Why is my overlapped WriteFile getting blocked? (repost)"
- Reply: Yan-Hong Huang[MSFT]: "Re: Why is my overlapped WriteFile getting blocked? (repost)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|