Re: [PATCH] MSVC: Windows-native implementation for subset of Pthreads API
- From
Andrzej K. Haczewski <ahaczewski@gmail.com>
- Date
- Nov 5, 2009, 08:51 UTC
- Message-ID
- <16cee31f0911050051m4cd29827nca9c8238b21461a0@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.2.00.0911041915120.10340@xanadu.home>
2009/11/5 Nicolas Pitre <nico@fluxnic.net>:
Show 11 quoted lines
> Careful. At the beginning of the function you'll find:
>
> if (delta_search_threads <= 1) {
> find_deltas(list, &list_size, window, depth, processed);
> return;
> }
>
> That is, if we have thread support compiled in but we're told to use
> only one thread, then the bulk of the work splitting is bypassed
> entirely. Inside find_deltas() there will still be pthread_mutex_lock()
> and pthread_mutex_unlock() calls even if no threads are spawned.Ah, I wasn't aware of that. Actually why would find_deltas lock if no threads are used? Maybe, for non-threaded call to find_deltas, locking could be factored out?
-- Andrzej