git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (Apr 2012, #06; Sun, 15)

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Apr 19, 2012, 13:38 UTC
Message-ID
<CACsJy8DbyxOj6Qt-VrW7qzPHGCrrwqaq_oUon5zUsACyFRt8Lw@mail.gmail.com>
In-Reply-To
<CABPQNSb9BSfmGu2bYtZUndgkTom=r+Ho_CKsDr7wo=jfxiXEjA@mail.gmail.com>
On Thu, Apr 19, 2012 at 8:31 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
Show 19 quoted lines
> On Thu, Apr 19, 2012 at 3:18 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>> On Thu, Apr 19, 2012 at 7:58 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
>>> This approach has the problem that file-operations apart from pread
>>> might (at least in theory) modify the position. To prevent that, we'd
>>> either need to use the same locking-mechanism as the CRT use, or use
>>> ReadFile with an OVERLAPPED struct, which allows us specify the offset
>>> explicitly. The latter seems better to me, and should look something
>>> like this (note: untested):
>>
>> Yeah. I read about ReadFile [1] but dismissed it when I got to async
>> i/o mode. Reading again, sync i/o ReadFile with OVERLAPPED struct
>> should work fine. It's not clear though if file offset is changed
>> (pread man page says it does not change).
>>
>
> A quick test shows that it does not:
> ...
>
> So this looks fine to me.
Great. We now wait for good news from Johannes then.
Show 6 quoted lines
>> Also this approach deals with Windows only. There's still another
>> NO_PREAD user, HP-UX something, and NO_PREAD comment mentions cygwin
>> before v1.5.22. I personally don't care, just wanted to point out.
>
> Yeah. Other platforms are still an issue. You didn't address those
> either in your patch,
No I didn't. Your patch made me see that.
Show 6 quoted lines
> even though it would be possible to modify it to
> deal with them by checking the NO_PREAD and NO_PTHREADS defines.
>
> But they would still have the problem with the file-pointer racing for
> non-pread operations. Perhaps simply disabling threading is the better
> choice for these?
That sounds like a safe choice. I'll make a patch to do that.
-- 
Duy
Previous: Erik Faye-LundNext: Johannes Sixt
Message 15 of 19 in “What's cooking in git.git (Apr 2012, #06; Sun, 15)”
  1. Junio C HamanoApr 16, 2012
  2. Nelson Benitez LeonApr 16, 2012
  3. Junio C HamanoApr 16, 2012
  4. Nelson Benitez LeonApr 16, 2012
  5. Junio C HamanoApr 16, 2012
  6. Johannes SixtApr 18, 2012
  7. Ramsay JonesApr 18, 2012
  8. Johannes SixtApr 19, 2012
  9. Johannes SixtApr 19, 2012
  10. Nguyen Thai Ngoc DuyApr 19, 2012
  11. Nguyen Thai Ngoc DuyApr 19, 2012
  12. Erik Faye-LundApr 19, 2012
  13. Nguyen Thai Ngoc DuyApr 19, 2012
  14. Erik Faye-LundApr 19, 2012
  15. Nguyen Thai Ngoc DuyApr 19, 2012
  16. Johannes SixtApr 19, 2012
  17. Erik Faye-LundApr 19, 2012
  18. Nguyen Thai Ngoc DuyApr 21, 2012
  19. Nguyen Thai Ngoc DuyApr 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.