Skip to content

Conversation

@xvallspl
Copy link
Contributor

@xvallspl xvallspl commented Sep 19, 2017

If IMT is enabled, TThreadedObject should allocate as many slots as threads the pool has been set with.

This PR will be updated with another default value for fgMaxSlots once PR #1018 has been agreed upon and merged.

If IMT is enabled, TThreadedOject should allocate as many slots as
threads the pool has been set with.
@xvallspl xvallspl requested a review from dpiparo September 19, 2017 16:10
@xvallspl xvallspl requested a review from pcanal as a code owner September 19, 2017 16:10
fModel.reset(Internal::TThreadedObjectUtils::Detacher<T>::Detach(new T(std::forward<ARGS>(args)...)));

if(ROOT::IsImplicitMTEnabled()) {
TThreadedObject<T>::fgMaxSlots = ROOT::GetImplicitMTPoolSize();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the value for each TThreadObject creation?

Also, in order for this line (and the next) to be thread safe fgMaxSlots needs to be an std::atomic. [Otherwise, per the standard, the behavior when the reading (line 167) and the writing (line 164) happen at the 'same time' is undefined]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will look into it 🤔

Copy link
Contributor

@eguiraud eguiraud Sep 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcanal doesn't everything go bonkers anyway if users call EnableImplicitMT in a thread while they are using implicit-mt-aware features in other threads concurrently?

In other words, shouldn't EnableImplicitMT be called strictly before doing anything that checks whether implicit-mt is enabled or not?

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, ubuntu14/native with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@xvallspl
Copy link
Contributor Author

Does fgMaxSlots have to be static? I can't figure out the reason apart from wanting to keep the slot size heterogeneous at any point of the program.

I would need it to be local for dependency on IMT behaviours to make sense.

@xvallspl
Copy link
Contributor Author

xvallspl commented Dec 7, 2017

@dpiparo What do we make of this? It needs a refresh, but is this the right approach performance wise?

@etejedor
Copy link
Collaborator

@dpiparo @xvallspl have you discussed the fate of this one?

@etejedor
Copy link
Collaborator

@dpiparo , @xvallspl left it up to you to close this one

1 similar comment
@etejedor
Copy link
Collaborator

@dpiparo , @xvallspl left it up to you to close this one

@lmoneta
Copy link
Member

lmoneta commented Jan 29, 2019

@dpiparo what do you want to do with this one ?

@xvallspl
Copy link
Contributor Author

IIRC, not relevant anymore. Closing.

@xvallspl xvallspl closed this Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants