[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnubg] Multithreaded rollouts
From: |
Jonathan Kinsey |
Subject: |
Re: [Bug-gnubg] Multithreaded rollouts |
Date: |
Fri, 09 Feb 2007 08:59:01 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0 |
Christian Anthon wrote:
> Hi Jon,
>
> the code compiles on linux and appears to be working using the
> g_atomic equivalents. But I'm on a single cpu/core computer so I can't
> really test it. A couple of comments though: I thought that the
> interlock functions was equivalent to a++ not ++a, but perhaps I'm
> just tired right now, and you need to include multithread.h
> unconditionally in rollout.c.
The thread safe increment can be either way around, what's essential is
that the operation is atomic, i.e. if two threads call the function at
the same time they should get different values. I'll write a simple
test to check if it's working (with glib) here.
Jon
signature.asc
Description: OpenPGP digital signature