in reply to Re^2: Use perl type without perl
in thread Use perl type without perl
In a single-threaded perl, there is only one copy of stuff like current working directory, environment etc.
In a multi-threaded perl, each thread needs its own copy of that information.
So, for the single-threaded perl, the PERL_CONTEXT can be known at compile time and linked statically into code. A single static pointer to a struct that contains all the per-thread information is all that is required, because there is only one thread.
In a multi-threaded perl, each function that needs access to the "current PERL_CONTEXT" need to be able to find the appropriate context for the thread it is running in; hence it needs the my_perl variable which tells it which context that is.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Use perl type without perl
by bulk88 (Priest) on Sep 25, 2012 at 17:13 UTC | |
by BrowserUk (Patriarch) on Sep 25, 2012 at 17:20 UTC | |
by bulk88 (Priest) on Sep 25, 2012 at 17:28 UTC | |
by BrowserUk (Patriarch) on Sep 25, 2012 at 17:56 UTC | |
by bulk88 (Priest) on Sep 25, 2012 at 18:27 UTC | |
|