This is the mail archive of the mailing list for the pthreas-win32 project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Windows process very slow using more than one condition variable

Hi all,
I investigated more the problem and it looks that the pthread_cond_timedwait never respect
the timeout I gave as input. I observed that also the Sleep Windows API never respect
his arguments in millisecs.

   Do you know which could be the problem?

Giuliano Catrambone wrote:
Hello guys
I have a program which is portable on windows and Linux and I'm using pthread-win32
for the Windows version.

In my scenario I have one events queue and many threads acceding to this queue
to get events (consumers) and to add events (producers).

Every event has, as property, the consumer thread type addressee which has to get the event.

In my implementation I use as many condition variables as the number of different cunsumer types.

In this way, every time an event for the consumer X is added into the queue, a pthread_cond_signal
is called on the condition variable where only the consumer X is in timedwait.

If I have only one consumer type, and then one condition variable, the process on Windows is very fast
and works fine.
If I have more than one consumer types, and then more than one condition variables, the process on Windows
is very slow.
BTW, the same code, on linux, works fine also with many consumer types threads and then many condition variables.

Do you have some ideas why Windows seems works very slow using more than one condition variables?

Giuliano Catrambone
Director, Professional Services

Open source projects:

Home page:

Streaming page:

Mobile +39.393.8816655
Fixed: +39.02.90377228
Skype: Catrambone Giuliano
Yahoo: giuliano.catrambone

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]