The stupid question is the question not asked | |
PerlMonks |
Re^4: How to share complex data structure in threads ?by exilepanda (Friar) |
on Dec 30, 2012 at 10:16 UTC ( [id://1010905]=note: print w/replies, xml ) | Need Help?? |
THANK YOU VERY VERY VERY MUCH Pope!! A very great lesson learned!
These examples explained everything that I was missing. My real project is hard to explain, as the project scope is still defining, but from what I can understand, the structure is sound like a "online ARPG game". So, there's a World Map, and there's monsters, and players. So, whenever a player is connected, a new thread created, while everyone will access the same world map. When players walk, they may able to see monster or other players. and their coords changed, which should able to reflect to other players. And by certain time, killed monsters will reborn. This is almost the case I am likely to face. Indeed, this is more safe in the "queue" approach, but on the other side, I believe I will create more bugs while coding as the full picture is harder to retrieve. However one situation is true here which is fuzzy condition acceptable. Glitch from time race is acceptable in a certain amount of range. Indeed, I still can't decide which approach is better for me
In Section
Seekers of Perl Wisdom
|
|