View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000335JANAFeature Requestpublic2013-04-03 10:512013-12-13 16:32
Assigned Todavidl 
PlatformOSOS Version
Summary0000335: Add user settable reference to JEventLoop
DescriptionSometimes there is need to have an object that is thread specific. For example, a random number generator object in mcsmear. The overhead of maintaining this in a list that one then needs to lock a mutex to access every event is unnecessary. Similarly for creating a factory object and accessing the random number generator through that.

If a user-definable reference were added to JEventLoop, one could set it once and then access it at event time without mutex locking.

This could be done in a simple C-style way where the value is kept as a void* and it is up to the user to cast it back to the appropriate form.

Alternatively, one could use templated methods in JEventLoop to record not only the value, but rtti info so that it can be checked upon retrieval (value would be stored as void* in JEventLoop, but converted by template method before returning). This would be safer, but would add a little more overhead. Presumably not as much as mutex locking though. This second method would also allow for more than one type of reference to be stored, though again, for a slight overhead cost.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
davidl (administrator)
2013-12-13 16:32

This has been committed (with unit test!) and will be in JANA 0.7.0

- Issue History
Date Modified Username Field Change
2013-04-03 10:51 davidl New Issue
2013-12-13 16:32 davidl Note Added: 0000581
2013-12-13 16:32 davidl Status new => resolved
2013-12-13 16:32 davidl Resolution open => fixed
2013-12-13 16:32 davidl Assigned To => davidl

Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker