← Back to team overview

yade-dev team mailing list archive

Re: How to use a plugin

 

Thanks, Vaclav.  What I did was I put this in the hpp file:
boost::mutex globalMutex;

And this inside the function, which uses my variable idA:
boost::mutex::scoped_lock lock(globalMutex);


But I think i still have some more problems that isn't obvious yet at the moment.


Yours,

Boon
----------------------------------------
> From: eudoxos@xxxxxxxx
> To: yade-dev@xxxxxxxxxxxxxxxxxxx
> Date: Fri, 9 Apr 2010 16:50:17 +0200
> Subject: Re: [Yade-dev] How to use a plugin
>
>
>> I used global mutex. Now it works.
> Hi boon, congratulations!
>
> Sorry I didn't reply earlier. Can you briefly describe your solution? I
> had similar problems, that passing pointer to function somehow made
> omp_get_thread_num() return garbage (at least it seemed to).
>
> Note that if you want to run multi-threaded (for performance), you can
> store those globals in array (initialized to size omp_get_max_threads())
> and retrieve per-thread pointer by
> yourStaticArray[omp_get_thread_num()].
>
> Cheers, vaclav
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969


Follow ups

References