Multithreading & Compatibility
peng
Is there a way to transfer waves & variables to
ThreadSafe
functions other than using parameters?Eg.: constants or maybe structures??
These long lines make (my) Igor code even more ugly than it is already…
And more importantly, it is very inconvenient or even limiting.
I would like to access waves that are not changed during the operation.
Further, we found (probably once more...) that
wave/Z
is default under MacOS even without the /Z-flag - but not under Windows.(Using
#pragma rtGlobals=3
on both machines.)Why? How to avoid this?
Thanks for your advice.
E.g.
variable i
EndStructure
ThreadSafe Function DoStuff(s)
STRUCT MyStruct &s
print s.i
End
Function CallIt()
STRUCT MyStruct s
s.i = 123
DoStuff(s)
End
Or are you thinking of the input/output queues?
May 7, 2015 at 01:47 am - Permalink
It seems I finally have to dig into the concept of structures... I am still learning...
If this allows me to exchange a set of waves and variables between multithreaded functions & the main thread, that is probably the solution.
It was not clear to me if structures are applicable to multithreading since it is not mentioned in the help text.
I currently apply an adaption of the Group-at-a-Time Method example from the help text.
But for my next project I should probably get familiar with input/output queues, too.
Thanks for mentioning.
What about the wave/Z Mac vs. Win issue?
May 7, 2015 at 05:46 am - Permalink
Please clarify what the issue is. This doesn't sound like something that would behave differently on different platforms. A description of what you get and what you expect and the code you are using to do the test would be helpful.
May 7, 2015 at 07:13 am - Permalink
Executing waveZ_issue() gives an error "expected wave name" under Windows.
But it runs smoothly under MacOS.
Killwaves/Z dummy
wave dummy
Make/N=2 dummy = p
print dummy
End
May 8, 2015 at 09:56 am - Permalink
Just a hunch... maybe you have NVAR SVAR WAVE checking enabled on the windows machine but disabled on MacOS?
May 11, 2015 at 10:10 am - Permalink
Thanks for the hint, serrano.
(Still I dont really see the point in this assistive restriction...)
May 12, 2015 at 03:10 am - Permalink