I want to use multithreading in a project. I use Julia in VS Code and use the build-in profiler of the VSCode extension. The 8 threads appear in the profiler dropdown menu, but all threads except the first only have one horizontal block that says “root” and it seems as if they are not used at all.
I’m using windows. I start julia with 8 threads and Threads.nthreads() returns 8. I used the example from Polyester.jl and increased the size of x and y to 10 000 000, because I want to benchmark it and use the Profiler and I got the “There were no samples collected.” warning with smaller arrays.
I think that multiple threads are used since the benchmark times vary between the functions and I can see in the windows task manager, that multiple cores work when executing the multithreaded functions.
As described above, the profiler doesn’t indicate that any work is done in the 7 other threads. I tried to use ProfileView instead of the VSCode profiler and it doesn’t even display any indication that there is more than one thread.
Has someone ideas why this is happening?
In case the Polyester code is a bad example, could someone suggest a better one?
As Windows developers seem to be a rare commodity, the code for multithreaded sampling has not yet been written for Windows. There is all the data needed and structures present, but nobody has yet bothered to submit a PR to add the requisite for-loop over all of the threads. That could be you?