[gecode-users] Naive CCP ask in Gecode
Mauricio Toro
mauriciotorob at gmail.com
Tue Mar 11 10:10:37 CET 2008
Hello Mr. Schulte,
I had many threads doing something like this:
//pthread start
while ( not root[j+n].assigned() ){ gecode::status()};
gecode::status();
if (root[j+n].val() == 1)
rel(this, root[i+n], IRT_EQ, 1);
//pthread end
But, since Gecode is not thread safe, I should
only have one thread asking if the variables are
assigned and calling the propagators, right?
Thank you very much,
Sorry for asking so much.
Mauricio
2008/3/11, Christian Schulte <cschulte at kth.se>:
>
> What you can always do, is compute a fixpoint for a space (via status())
> and the find out.
>
>
>
> Christian
>
>
>
> --
>
> Christian Schulte, www.ict.kth.se/~cschulte/
>
>
>
> *From:* users-bounces at gecode.org [mailto:users-bounces at gecode.org] *On
> Behalf Of *Mauricio Toro
> *Sent:* Monday, March 10, 2008 11:31 PM
> *To:* gecode at gecode.org
> *Subject:* Re: [gecode-users] Naive CCP ask in Gecode
>
>
>
> Hello all,
>
>
>
> I am trying to use Gecode for make some ccp processes.
>
> something like:
>
>
>
> when a = 1 do tell b = 1
>
> || when b = 1 do tell c = 1
>
> || tell a = 1
>
> || when b = 1 and c = 1 do tell answer = true
>
>
>
> with a,b,c all in the same intvararray (in the same space),
>
> how can i make that?
>
>
>
> thanks
>
>
>
> 2008/3/10, Mikael Zayenz Lagerkvist <zayenz at gmail.com>:
>
> Hi,
>
> If you are using a Gecode Space in a concurrent setting, there are a
> couple of things that you must observe.
>
> First of all, a Space is not reentrant. Thus you must serialize all
> accesses to the Space object.
>
> Secondly, if you want to manipulate two different Spaces concurrently,
> you must make sure that they do not share any data structures. This is
> done by passing false as the share argument when cloning a Space.
>
> Cheers,
> Mikael
>
>
> On Mon, Mar 10, 2008 at 12:54 PM, Mauricio Toro <mauriciotorob at gmail.com>
> wrote:
> > Hello,
> >
> > I am trying to do a naive CCP ask in Gecode and
> > I am getting "Bus error".
> >
> > The idea is doing this process inside a thread
> > ask (a = 1) do tell( b = 1)
> >
> > I am doing it like this:
> >
> > while ( not root[i].assigned() ){ };
> > if (root[i].val() == 1)
> > rel(this, root[j], IRT_EQ, 1);
> >
> > Any clues why I am getting "Bus error",
> >
> > Thanks
> >
> > --
> > Mauricio Toro Bermudez
> > Estudiante de Ingeniería de Sistemas
> > Pontificia Universidad Javeriana, Colombia
> >
> > Stagiare à l'Ircam
> > 1, place Igor-Stravinsky 75004 Paris,
> > France de 2008 à 2009
>
> > _______________________________________________
> > Gecode users mailing list
> > users at gecode.org
> > https://www.gecode.org/mailman/listinfo/gecode-users
> >
> >
>
>
>
>
> --
> Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
>
>
>
>
> --
> Mauricio Toro Bermudez
> Estudiante de Ingeniería de Sistemas
> Pontificia Universidad Javeriana, Colombia
>
> Stagiare à l'Ircam
> 1, place Igor-Stravinsky 75004 Paris,
> France de 2008 à 2009
>
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080311/00048077/attachment.htm>
More information about the gecode-users
mailing list