Dan Sugalski wrote:
Leopold Toetsch wrote:
Again, not only strings but all kind of containers using managed resources suffer from that problem.
All that seems to imply, that we need two locks for shared access: one
for protecting DOD/GC and a second for the PMC. Any container (including
PerlStrings) would have to aquire the first (interpreter-global) lock,
while a PerlNum only needs the second per PMC mutex. Ugly.
Yeah, it all potentially gets nasty.
[...]
[3] They can't be suspended inmidst of an arbitrary operation (and pthread doesn't even provide suspending) so they would be sent a suspend event so that they are in a safe state in the run-loop, or better in the event-handler opcode, called from there.
(Just got back from vacation and was reviewing this aging thread...)
Yes, yes! Stopping other threads when a rare condition occurs is a great way to avoid penalizing a threaded program's common case with excessive synchronization overhead. There are just too many things that can go wrong otherwise; fine-grained locking is the alternative, and programs will very, very rapidly find themselves spending 40% of their cycles acquiring mutexes.
This is definitely the way to go to achieve blistering performance while retaining dynamic capabilities. The work is already done to ensure that while true { ; } will receive events in a timely fashion. Broadcasting parrot events should be an excellent means of implementing inter-thread synchronization.
—
Gordon Henriksen [EMAIL PROTECTED]