Re: PRLock with 2 conditional variables

Wan-Teh Chang <[email protected]> Mon, 10 Nov 2008 10:08:53 -0800
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
On Mon, Nov 10, 2008 at 6:27 AM, [email protected] <[email protected]> wrote:
> Hi,
>
> is using single PRLock with 2 conditional variables to selectively
> wake up different threads works and faster than using 2 locks with one
> conditional per lock?

I don't know without more information.  You'll need to measure it.
You may find that there is no difference in performance.

Note that you may need to use a single PRLock or two PRLocks,
depending on the data you are protecting.  So it's possible that for
correctness, you only have one option.

Wan-Teh