Shared Modules and Data 
Author Message
 Shared Modules and Data

Would I be right in thinking that if I put several procs. into the same
'Module' - they can all share their data ? Queues - Local Data - etc.

Are the instances of opened File Records the same ?

Thank you.



Tue, 20 Sep 2005 21:38:35 GMT  
 Shared Modules and Data
Additional data scopes:  DLL, Class, Routine

I am in the process of removing my module data, and wrapping it in a
class.  Once in a class, you can still have the advantages of shared
variables without having to pass them between each procedure
(side-effect), but since each class can be instantiated on its own
thread, you aren't exposed to multiple threads messing with the same
modular data simultaneously.

Files are _usually_ (but not always) declared globablly with a
thread attribute.  You can declare files in classes, modules and
procedures (and of course DLLs too).  A file, like any other data
type is only available to all procedures in its scope.  To break out
of the scope, you would have to a pass a reference out of the scope.

Note: I'm not sure if you can declare a file in a routine.

How about that for some even muddier water <G>

--
www.Tradesmens.com
Mark Goldberg


Quote:
> Ken,

>     You can have several data scopes: Global, Module, Procedure
and
> Local Procedure (I believe those are the proper names and order).
> Basically, code in each of the levels can see whatever is "above"
it.
> That is, procedural code can see data declared in Global, Module
and
> Procedure but NOT something a Local Procedure.

>     Does that muddy up the waters enough for you?

>     Regards,

>     kurtt

>     Kurt Pawlikowski
>     The Pinrod Corporation

>     (773) 284-9500
>     http://pinrod.com


>> Would I be right in thinking that if I put several procs. into
the same
>> 'Module' - they can all share their data ? Queues - Local Data -
etc.

>> Are the instances of opened File Records the same ?

>> Thank you.



Tue, 20 Sep 2005 22:39:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. sharing data between modules

2. Prob sharing MODULE data between DLLs

3. multi-process shared data and thread private data

4. Modules shared between two apps?

5. Modules and shared libraries

6. Sharing a file across sub-modules

7. shared memory module bugs?

8. shared mem & semaphores module

9. Python on Mac OS X w/shared modules

10. Problem building shared library for C module

11. Shared Memory Module

12. Loading shared modules from an imbedded interpreter

 

 
Powered by phpBB® Forum Software