But that also seems not to work on Windows systems. That is, it never worked for me. But that also seems not to work on Windows systems. That is, it never worked for me.
Again, my best guess is that the reason it doesn't work for you is because you are using '98. It works for me on NT & XP.
You say it'll depend on how my code is currently structured, but that's no important issue.
Why it is important is that you cannot call objects across threads using Perl's iThreads implementation. You can share data, but not code pointers, ie. methods. That makes utilising objects with threads awkward.
You could use a thread to interact with the user and queue the input to the main thread that manipulates the objects. That is pretty easy to do, but actually only achieves the same as putting a timeout on the IO, hence teh mention of ReadKey().
If you thought is to make each NPC a separate thread running around on it's own and interacting when they come into contact, the problem is need to share the environment between threads. If the environment is also represented using objects, the problem of sharing those objects between threads returns.
In reply to Re: Re: Re: Re: Re: Data copied with fork() -> how to access true data?
by BrowserUk
in thread Data copied with fork() -> how to access true data?
by muba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |