frost-devel Mailing List for The Frost Project
Status: Beta
Brought to you by:
julianb
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
|---|
|
From: Julian v. B. <ja...@gm...> - 2000-10-29 10:08:41
|
Hi! The shared library support would work like this: When shared libraries are enabled, no dispatching code is statically linked to the executable by Frost. Instead a dynamic loader is triggered when a function with virtual arguments is called. This loader loads the dispatching code and does the initialization. It connects via a unix domain socket to a daemon that is responsible for generating and caching dispatching code. It would not be necessary to generate it every time the program is started. The dispatching code depends on the functions and classes that are defined in the code of the executable, and the sonames of the shared libraries (and their .of files) that are linked to the program. The executable would have to contain all the information. The sonames are no problem, but the .of file for the executable can become somewhat large. (A .of file for the whole STL is about 80k large; go to the test directory of the source distro, run 'frost -c test1.ccf', and have a look at test1.of) To reduce overhead, the loader passes only the sonames and a checksum of the .of file to the daemon. The daemon checks what libraries correspond to the sonames, reads the checksums of their .of files (if present), and looks up whether a library with dispatching code exists for that particular combination. If yes, the file location is passed to the loader. This could be reasonably fast. If not, the daemon requests the contents of the .of file from the loader. Those are stored in the executable. To reduce size the data is compressed. The daemon runs now Frost to combine all .of files and generate the dispatching code, and creates a new cache entry. It would only be necessary to do that at most once per program unless shared libraries are changed. To reduce overhead even more, it would be possible to cache not only dispatching code, but also .of files. Dynamic loading of shared libraries at runtime work similar: After a library has been loaded or unloaded, the dynamic loader is triggered again when a function with virtual args is called. I would like to hear your comments, questions, etc. about this. Julian |