Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Design thoughts: iterator invalidation

by BrowserUk (Patriarch)
on Feb 21, 2015 at 14:11 UTC ( [id://1117421]=note: print w/replies, xml ) Need Help??


in reply to Re: Design thoughts: iterator invalidation
in thread Design thoughts: iterator invalidation

Personally, I don't think I'd trust the iterator after changing the hash, but I'd probably hope that it would iterate until there are zero keys in the hash that it has not yet returned.

There are two problems with that statement:

  1. How would you know that the hash had changed if the change(s) occur in (a) different thread(s).
  2. Remembering which keys have already been returned would impose a huge burden.

    Ditto: noticing that a new key had been added at a point preceding the current position of the iterator.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^3: Design thoughts: iterator invalidation
by SuicideJunkie (Vicar) on Feb 24, 2015 at 17:49 UTC

    I do agree that it would probably be terrible to actually implement, moreso with threads involved. It would just be convenient if it magically worked that way.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1117421]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-28 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found