ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: (blead patch) New TRIE regex patch
by Dave Mitchell other posts by this author
Mar 1 2005 8:16PM messages near this date
Re: (blead patch) New TRIE regex patch | Re: (blead patch) New TRIE regex patch
On Wed, Mar 02, 2005 at 04:08:38AM +0000, hv@[...].org wrote:
>  Hmm, locking a 'refcount--' doesn't make much sense to me: if two threads
>  both do this at the same time, they'll still then both try to free the
>  structure. But I see that op_free() does essentially the same thing,
>  which confuses me. Can anyone explain how that makes sense?

I haven't been following this thread closely (I don't even know what a
trie is), but I'll chip in anyway.

In the op_free() case, an op tree may be shared by CVs from differnt threads.
The head of the tree contains an OP refcnt, so OP_REFCNT_LOCK is used to
lock it before decrementing it.

On the other hand, using OP_REFCNT_LOCK to lock an SV doesn't seem to make
much sense (but as I said, I havn't been paying close attention).

Dave.

-- 
There's a traditional definition of a shyster: a lawyer who, when the law
is against him, pounds on the facts; when the facts are against him,
pounds on the law; and when both the facts and the law are against him,
pounds on the table.
    -- Eben Moglen referring to SCO
Thread:

Yitzchak Scott-Thoennes
Demerphq

Demerphq
Yitzchak Scott-Thoennes

Dave Mitchell
Demerphq
Dave Mitchell
Demerphq
Dave Mitchell

Demerphq
Demerphq
Yitzchak Scott-Thoennes
Rafael Garcia-Suarez

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved