Beg your pardon, I lost the CC. regards.
----- Forwarded message from [EMAIL PROTECTED] ----- Date: Wed, 11 Jan 2006 02:16:10 -0600 From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Subject: Re: matrix linking To: Sean Callanan <[EMAIL PROTECTED]> Dear Sean. Thank you very much for you reply. I will try to answer for some of your questions. > In short, you are proposing that instead of linking an executable, it > be made into a bunch of shared libraries. The function calls > between these shared libraries be arbitrated by a "dispatcher" which > can dynamically reroute function calls. In short yes. > There already exists a technique to do this if you're willing to > restart your app: incremental linking. Many IDEs support something > like this (it's called ZeroLink in Apple's Xcode, for example), and > even GNU ld has the -r option, which makes an object file > relocatable, making it quicker to link. Incremental linking is quite different thing; it goes in parallel with idea of Matrix Linking. For instance those modules which take part in matrix linking might be linked incrementally, do not see any problems here. > If you want to be able to do this without restarting, there are some > challenges: A lot of challenges here. A mess of them. Therefore I raised a site, to collect everything I have got on the matter, therefore if you would not mind I will put these one you mentioned to the schedule. > 1) Static variables in modules would present problems, as these would > have to somehow be reinitialized to their values in the old module > (for instance, if you have a static pointer to a malloc()ed data > structure). > 2) If you plan to interpret code, the C interpreter would have to be > taught to access symbols in other modules if they are undefined in > the module it is interpreting. Interpreter is the weakest thing here, its communication with compiled code especially. By now I am trying to modify GCC (cc1) in such way it would be possible to apply matrix linking for .C modules only, C++ by now looks to be unsolvable task, that was the purpose of my writing, actually. > > 3) You would have to figure out how to interpose on functions called > via function pointers. > 4) In a multithreaded application, you'd have to make sure that > module replacement is atomic and you handle the case of replacing a > module at a time where a thread is executing a function in it. Some solutions I am putting here: http://docs.georgeshagov.com/twiki/tiki-index.php In a very brief. Let me get back to my initial purpose. I need some kind of assistance with cc1 sources. Videlicet I am trying to modify it in such way that during the compilation of .C module on function description it would automatically produce additional code (stub-function), and proxy function. These ones to be compiled by some template, its compiled code (I thing the assembler) is to be inserted in the original module. The entire calls to the function are to be redirected through the external matrix. This is my initial plan. I can not say I am not able to do it by myself, but if someone from GCC team would assist that would be just perfect. I mean both, the architectural approach and details of implementation. I have some specific question regarding GCC code, but by now the question is: will someone from GCC team cooperate or not? That is my initial purpose. Sincerely yours, George. Quoting Sean Callanan <[EMAIL PROTECTED]>: > In short, you are proposing that instead of linking an executable, it > be made into a bunch of shared libraries. The function calls > between these shared libraries be arbitrated by a "dispatcher" which > can dynamically reroute function calls. > > There already exists a technique to do this if you're willing to > restart your app: incremental linking. Many IDEs support something > like this (it's called ZeroLink in Apple's Xcode, for example), and > even GNU ld has the -r option, which makes an object file > relocatable, making it quicker to link. > > If you want to be able to do this without restarting, there are some > challenges: > > 1) Static variables in modules would present problems, as these would > have to somehow be reinitialized to their values in the old module > (for instance, if you have a static pointer to a malloc()ed data > structure). > > 2) If you plan to interpret code, the C interpreter would have to be > taught to access symbols in other modules if they are undefined in > the module it is interpreting. > > 3) You would have to figure out how to interpose on functions called > via function pointers. > > 4) In a multithreaded application, you'd have to make sure that > module replacement is atomic and you handle the case of replacing a > module at a time where a thread is executing a function in it. > > Perhaps others on this list can come up with more issues to resolve. > If you can come up with a solid system that addresses the issues > with dynamic replacement of code, you will probably be able to get > at least a conference paper and possibly even a job out of it :) > > Sean > > On Jan 10, 2006, at 7:32 AM, [EMAIL PROTECTED] wrote: > >> Dear Sirs. >> >> At the first, let me put a lot of appreciations for what you are doing. >> >> At the second, respecting your time, I will straight to the matter. >> I have some kind of an idea, which I called 'matrix linking'. It >> would appear >> this is a new kind of linking. Briefly it gives (C/C++) developer the >> opportunity to change the business logic of the application at run- time, >> neither recompilation nor restarting required. The point is that >> the approach >> makes possible to substitute any function of the code, in such wise some of >> them might be merely executed by means of a script machine >> (interpreter). The >> basic concept and the simple realization of the idea are represented here: >> http://www.georgeshagov.com/matrixlinking/MatrixLinking/ >> MatrixLinking.pdf. (I >> am attaching the article to the message) >> >> I had some ideas how to put the invention in solution (here: >> http://docs.georgeshagov.com/twiki/tiki-index.php, >> http://docs.georgeshagov.com/twiki/tiki-index.php?page=Matrix >> +Linking+-+The+shortest+way+to+go). >> >> What do I want from you is some kind of assistance. Of cause I have >> GCC sources >> and manuals, theoretically it is enough to make the changes, yet, >> if someone >> from GCC team had assist me in that the result would be much >> better, since you >> know the compiler much better than I. >> >> For instance. By now I have these questions: >> * I am looking at build_function_call and start_function functions, >> these ones >> actively use 'tree'. I am not familiar with that. So,: >> ** Is there any documentation on that? >> ** Is there any help functions which works with 'tree', like doing >> iteration, >> dumping and so on. >> ** What are the external values for cc1? File name for instance, >> and so on. >> >> I do understand that these questions seem to be really abstract. >> But I think >> that to contact GCC team at the very beginning of the investigation >> should be a >> good idea. For it might be (I believe should be) some architectural >> solution, >> which might be offered by you will be really useful in the future. >> >> Therefore dear Sirs, if you find the idea interesting and some one >> of you will >> find a time and a wiliness to cooperate I would be really appreciate. >> >> Sincerely your, George. >> <MatrixLinking.pdf> > > ----- End forwarded message -----