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

Re: [PATCH v3] Threaded grep

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jan 18, 2010, 13:45 UTC
Message-ID
<4B546608.4010503@viscovery.net>
In-Reply-To
<4c8ef71001180528h6182ef4l8a617fd038bd7318@mail.gmail.com>
Fredrik Kuivinen schrieb:
Show 8 quoted lines
> On Mon, Jan 18, 2010 at 12:11, Johannes Sixt <j.sixt@viscovery.net> wrote:
>> Fredrik Kuivinen schrieb:
>>> +     pthread_mutex_unlock(&grep_lock);
>>> +     pthread_cond_signal(&cond_add);
>> Please swap these two lines, so that pthread_cond_signal() is called while
>> the lock is held.
> 
> May I ask why? (just curious)

Because our pthreads_cond_* functions on Windows are not POSIXly correct and work reliably only when pthread_cond_signal() is called while the mutex is held.

-- Hannes
Previous: Fredrik KuivinenNext: Linus Torvalds
Message 4 of 10 in “Threaded grep”
  1. Threaded grepFredrik Kuivinen, Jan 18, 2010
  2. Johannes SixtJan 18, 2010
  3. Fredrik KuivinenJan 18, 2010
  4. Johannes SixtJan 18, 2010
  5. Linus TorvaldsJan 18, 2010
  6. Fredrik KuivinenJan 19, 2010
  7. Linus TorvaldsJan 19, 2010
  8. Fredrik KuivinenJan 19, 2010
  9. Johannes SixtJan 19, 2010
  10. Fredrik KuivinenJan 25, 2010

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.