Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Perl threads under Windows
Octavian Rasnita wrote:
> I understand that the perl threads (at least under Windows) are actually
> a kind of separate processes that don't share the memory unlike the
> Windows native threads, and that's why they are not so slim as the
> Windows threads and why they can't share objects.
>

Yes and no.

ithreads creates a new Perl interpretter in each new thread, and
"clones" the context of the parent thread into the
new interpretter (in order to emulate a UNIX fork() operation
in the Windows environment). The ithreads architecture
applies to all platforms, not just Windows (as of Perl 5.6).

While data cannot be directly shared between each interpretter
context (and therefore, each thread), the threads::shared
module provides a tie'ed interface to another shared interpretter
context such that all the thread-private interpretters can
access the variables defined within the shared interpretter.
Unfortunately, the implementation suffers from significant
lock contention (access to the shared interpretter requires
a global lock), and some limitations (e.g., no shared closures,
no shared file handles).

Objects *can* be shared, assuming you follow the guidelines
specified in the threads::shared documentation (especially
the section titled "OBJECTS"). However, keep in mind the previously
mentioned global locking issues when creating such objects.
If you create a hash-based object, and then frequently reference
member fields of the hash, you could suffer serious performance
issues.

HTH,
Dean Arnold

Report this thread to moderator Post Follow-up to this message
Old Post
Dean Arnold
04-21-08 01:47 AM


Re: Perl threads under Windows
On Sun, 2008-04-20 at 08:32 -0700, Dean Arnold wrote:
> ithreads creates a new Perl interpretter in each new thread

I'm hoping that Parrot will implement some form of threading like POSIX
threads.  I guess that would not work under Windows but you could do
POSIX in UNIX and Windows type threads in Windows.


Report this thread to moderator Post Follow-up to this message
Old Post
Christopher Fowler
04-21-08 01:47 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): « 1 [2]
Search this forum -> 
Post New Thread

ithreads archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:01 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.