[PLUG] high cpu utilization

Navin Kabra navin.kabra at gmail.com
Wed Nov 11 09:29:12 IST 2009

On Sun, Nov 8, 2009 at 10:18 PM, Kapil Agrawal <kapil.agl at gmail.com> wrote:

> have to wait in thd_w again and again in a while loop polling for the data
> to be pushed queue from thd_r. Because of this polling using while, huge
> is getting consumed.

I've forgotten my multi-threaded programming, but isn't there a semaphore or
other such data structure that exists just for this purpose? thr_r sleeps on
the semaphore, and thr_w wakes it up when there is data?

A check of man pages should definitely help you find the appropriate mutex
based datastructure?


More information about the Plug-mail mailing list