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

discuss threads in importing vignette #6716

Open
tdhock opened this issue Jan 12, 2025 · 2 comments
Open

discuss threads in importing vignette #6716

tdhock opened this issue Jan 12, 2025 · 2 comments

Comments

@tdhock
Copy link
Member

tdhock commented Jan 12, 2025

@grantmcdermott suggested improving the importing vignette, by adding a discussion about how to avoid check issues about using too many threads. #5658 (comment)

I would suggest something like:

Add data.table::setDTthreads(1) to the top of your tests/*.R files and also at the top of the \examples section in man/*.Rd files.

@grantmcdermott
Copy link
Contributor

grantmcdermott commented Jan 13, 2025

Thanks @tdhock.

I think adding some nuance for different use cases (examples vs tests vs vignettes) would be helpful. See Jan's original comment here. E.g. For Examples, better to wrap in \dontshow{data.table::setDTthreads(2)}.

@aitap
Copy link
Contributor

aitap commented Jan 13, 2025

Maybe not only \dontshow{setDTthreads(...)} at the beginning, but also \dontshow{setDTthreads(.previously.saved.value); rm(.previously.saved.value)} at the end to minimise the changes to the global state.

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

3 participants