Multithreading & Compatibility

Hi Igor experts,

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.
You can already use structures as parameters in threadsafe functions.

E.g.
Structure MyStruct
    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?
Thanks for the quick reply to my first question.

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?
peng wrote:

What about the wave/Z Mac vs. Win issue?


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.
Here is a minimal example that produces the described behavior:
Executing waveZ_issue() gives an error "expected wave name" under Windows.
But it runs smoothly under MacOS.

Function waveZ_issue()
    Killwaves/Z dummy  
    wave dummy 
    Make/N=2 dummy = p
    print dummy
End
peng wrote:
Here is a minimal example that produces the described behavior:
Executing waveZ_issue() gives an error "expected wave name" under Windows.
But it runs smoothly under MacOS.

(...)
    wave dummy 
(...)
End


Just a hunch... maybe you have NVAR SVAR WAVE checking enabled on the windows machine but disabled on MacOS?

Silly me. :-/
Thanks for the hint, serrano.
(Still I dont really see the point in this assistive restriction...)