Re: [fpc-pascal] Shared libraries and threadvars

2012-06-27 Thread Mark Morgan Lloyd
Can such an alternative entry point in the main unit be called by a shared library, i.e. either resolved at load time or with the main binary reopened like a library? Or is the only way to pass a main- program entry point to a shared library by using it as a parameter to a procedure? I

Re: [fpc-pascal] Shared libraries and threadvars

2012-06-27 Thread Mark Morgan Lloyd
Mark Morgan Lloyd wrote: Can such an alternative entry point in the main unit be called by a shared library, i.e. either resolved at load time or with the main binary reopened like a library? Or is the only way to pass a main- program entry point to a shared library by using it as a

[fpc-pascal] Shared libraries and threadvars

2012-06-26 Thread Mark Morgan Lloyd
I'm currently tinkering with shared libraries, using cmem, mainly on Linux. In one case the main-program code is multithreaded, but so far I'm not moving data between threads inside the library. Am I correct in believing that unit-level variables in a shared library might end up being shared

Re: [fpc-pascal] Shared libraries and threadvars

2012-06-26 Thread Sven Barth
Am 26.06.2012 14:02 schrieb Mark Morgan Lloyd markmll.fpc-pas...@telemetry.co.uk: I'm currently tinkering with shared libraries, using cmem, mainly on Linux. In one case the main-program code is multithreaded, but so far I'm not moving data between threads inside the library. Am I correct in

Re: [fpc-pascal] Shared libraries and threadvars

2012-06-26 Thread Mark Morgan Lloyd
Mark Morgan Lloyd wrote: I'm currently tinkering with shared libraries, using cmem, mainly on Linux. In one case the main-program code is multithreaded, but so far I'm not moving data between threads inside the library. Am I correct in believing that unit-level variables in a shared library

Re: [fpc-pascal] Shared libraries and threadvars

2012-06-26 Thread Sven Barth
Am 26.06.2012 17:15 schrieb Mark Morgan Lloyd markmll.fpc-pas...@telemetry.co.uk: Mark Morgan Lloyd wrote: I'm currently tinkering with shared libraries, using cmem, mainly on Linux. In one case the main-program code is multithreaded, but so far I'm not moving data between threads inside the

Re: [fpc-pascal] Shared libraries and threadvars

2012-06-26 Thread Mark Morgan Lloyd
Apologies for my lousy message threading, but some are vanishing in the spamtrap. OK, so to emphasise that: library B's data will be common, irrespective of the location of the calling routine. Does this apply if the load is being done at runtime, i.e. the program is using dl (or whatever)

Re: [fpc-pascal] Shared libraries and threadvars

2012-06-26 Thread Sven Barth
Am 26.06.2012 20:09 schrieb Mark Morgan Lloyd markmll.fpc-pas...@telemetry.co.uk: One final question if I may: noting Ludo's example elsewhere: In the project.lpr add the following code: Procedure qt_startup_hook;export; Begin End; Exports qt_startup_hook; Can such an