[M3devel] Runtime only package for Windows? With preselected modules?

Jay K jay.krell at cornell.edu
Sun Oct 24 02:30:52 CEST 2010


With build_standalone you don't need to worry.
  As long as all your Modula-3 code is in one .dll per process.
  Er, I mean, as long as your Modula-3 is the .exe and no .dlls.


There is some need for shared state sometimes.
But if all the Modula-3 code is linked together, in the .exe, ok.


You know, imagine you have multiple Modula-3 .dlls loaded, standalone.
Which garbage collector? Maybe all of them, against their own allocations.
Maybe it is jus slow.


But what if you pass off Modula-3 traced references across .dll boundaries,
without sharing a garbage collector (m3core.dll). Then you'd have trouble.


This has nothing to do with Windows.
It is the general hazard of dynamic linking.


Sometimes dynamic linking is an opportunistic optimization.
  e.g. it doesn't matter if you share strlen or not. It is stateless. You can have
  any number of copies. More efficient to reduce, but not a big deal these days,
  with tons of disk space and address space and physical memory.


But sometimes a .dll is managing a shared resource.
e.g. some global variables.
Then having multiple copies of data/code can be confusing or very wrong.
e.g. consider something like setlocale().
Which code does it affect? Only code using the same C runtime.


Imagine I call fopen or malloc and give the result to another .dll that
calls fread or free. They have to share the same C runtime.
Or in a less likely case, the multiple C runtimes have to cooperate.


Same problem with CreateFile/ReadFile/CloseHandle, except
the system doesn't allow duplicate kernel32.dll or the underlying ntoskrnl.exe.


Think of "services".
For example there is "BITS" the background intelligent transfer service..
used by Windows Update. If you have more than one on a machine,
then the "background" and "intelligent" suffer.
But it'd still mostly work?


 - Jay

> From: dragisha at m3w.org
> To: m3devel at elegosoft.com
> Date: Sat, 23 Oct 2010 21:44:16 +0200
> Subject: [M3devel] Runtime only package for Windows? With preselected	modules?
> 
> I have a rpm spec file I am using and it by default makes cm3 package
> and cm3-devel. Also, it does not contain all modula-3 packages, as most
> of them are not used in typical cases.
> 
> Right now I am about to make install package for an application I am
> delivering and runtime libs only package for Windows is what is on my
> mind right now. Doable? Or I can skip it without problem with
> build_standalone() ? How do I confirm it's statically linked? Under
> linux I'll use ldd, but depends.exe (thanks Jay) does not show it to
> me...Or it does?
> -- 
> Dragiša Durić <dragisha at m3w.org>
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101024/56e18a25/attachment-0002.html>


More information about the M3devel mailing list