Re: [PATCH] MSVC: Windows-native implementation for subset of Pthreads API
- From
Nicolas Pitre <nico@fluxnic.net>
- Date
- Nov 5, 2009, 00:22 UTC
- Message-ID
- <alpine.LFD.2.00.0911041915120.10340@xanadu.home>
- In-Reply-To
- <4AF214D5.6050202@gmail.com>
On Thu, 5 Nov 2009, Andrzej K. Haczewski wrote:
Show 5 quoted lines
> @@ -1638,6 +1657,8 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size, > delta_search_threads); > p = xcalloc(delta_search_threads, sizeof(*p)); > > + init_threaded_search();
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.
Nicolas