Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logthreads and logqthreads seem to behave similarly #13

Closed
biona001 opened this issue Jun 25, 2020 · 2 comments
Closed

logthreads and logqthreads seem to behave similarly #13

biona001 opened this issue Jun 25, 2020 · 2 comments

Comments

@biona001
Copy link

biona001 commented Jun 25, 2020

Hello, I tested a for loop with the logthreads and logqthreads macro, but the resulting plot seem to behave quite similarly:

logthreads:
logthreads

logqthreads:
logqthreads

I expected each thread in logqthreads to be roughly the same length. Did I misunderstand something or is this a bug? There figures are produced at the end of this notebook. Sorry I didn't provide a MWE since this is quite complicated to generate.

@tro3
Copy link
Owner

tro3 commented Jun 26, 2020

You are absolutely correct! A couple logged version macro invocations got swapped - logqthreads is one. I will fix now and issue a new revision.

In the meantime, you can generate the correct macro with:

import ThreadPools: _pthread_macro, LoggedQueuePool, pwith, tforeach

macro logqthreads_fixed(args...)
  return _pthread_macro(LoggedQueuePool(1), true, args...)
end

pool = @logqthreads_fixed for w in 1:windows
  ...

@tro3 tro3 closed this as completed in 1b3d76b Jun 26, 2020
@tro3
Copy link
Owner

tro3 commented Jun 26, 2020

Now updated and released:

 pkg> update ThreadPools
...
 [b189fb0b] ↑ ThreadPools v1.1.0 ⇒ v1.1.1

Let me know if you have any trouble, and thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants