What is the difference between `Threads.@threads' and `Threads@threads'?

Hello.
I’m wondering what is the difference between Threads.@threads and Threads@threads?
for example in :

Threads.@threads for i=1:N
            A[i] = i
        end

Thank you.

Where have you seen Threads@threads, without the dot?

Please comment your code properly using `, see PSA: how to quote code with backticks.

Thank you.

Can you tell me What this dot means?
I have seen it in someone’s code on the internet.

The macro @threads (macros are identified by the leading at-sign) is defined inside the Threads module, but it’s not exported. Thus, in order to call it, you have use the syntax module.function, with the dot between the module’s name and the function’s name. You’ll find more in the manual: https://docs.julialang.org/en/stable/manual/modules.

In addition, note that Threads@threads is parsed as:

Threads * @threads

that is, multiplication between a module name and a non-existent macro (because it’s not exported).

1 Like

Thank you.