in reply to OO and Threads conflict?
$self->{thread} = threads->new(\&reader, $self); # Start thread
I think the concept of wrapping threads in objects is a little confusing and dangerous. A thread proc is different than a object function - it represents a new path of execution.
It may be cool to wrap a thread in an object but objects go out scope - $self will become invalid if the object goes out scope before thread function reader exits.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OO and Threads conflict?
by Aristotle (Chancellor) on Sep 21, 2002 at 22:40 UTC | |
by beamsack (Scribe) on Sep 21, 2002 at 23:07 UTC | |
by Anonymous Monk on Sep 22, 2002 at 12:42 UTC |