Ticket #8 (new defect)

Opened 1 year ago

Last modified 1 year ago

vpr::Thread::self() returns NULL for the primordial thread

Reported by: patrick Assigned to: allenb
Priority: major Milestone:
Component: VPR Version: HEAD
Keywords: thread Cc:
Completion:

Description

vpr::Thread::self() returns NULL in the primordial thread. This is because VPR did not start it, and therefore it doesn't know what thread it is.

This works, but leads to special cases in all code that references vpr::Thread::self() (such as thread-specific data and others). A "better" solution may be to have either a global primordial thread object that we return a reference to or to be even safer (in the case of multiple unknown threads) have an auto-growing list of threads indexed by the system thread id with pre-allocated vpr::Thread objects to return.

This should make it possible remove all the special case code and allow user code to just assume that there will be a valid vpr::Thread pointer returned in all cases.

Attachments

Change History

03/15/07 11:48:20 changed by patrick

This comment is from allenb:

Need to be sure to make sure that the thread pointer returned does something intelligent in the case of users calling methods on it like join().

In these cases we can't actually execute the method (in most cases), so the system should output a warning or something.


Add/Change #8 (vpr::Thread::self() returns NULL for the primordial thread)




Change Properties
Action