Thanks!

It'll take me a while to sort through that project well enough to understand
it (especially since I don't know LISP). However, I found an opcode Ldfld,
which according to documentation, "Finds the value of a field in the object
whose reference is currently on the evaluation stack." More information can
be found at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemreflectionemitopcodesclassldfldtopic.asp
At the moment I'm trying to figure out how to use the opcode Ldfld, but I
can't figure out how best to use it.

As to #1, what I would like to do is have a jmp instruction that, since I
could keep it a constant size, could be editable. It would cost me 1 extra
instruction per call, but that's not bad. Baring that, every time a function
is altered, I plan to recompile every function that points to it in order to
point to the new function. But, before I can do that, I need to know when
garbage collection will take my old version. If I recompile all the
functions that call a specific function, if a thread that's currently
executing/waiting/suspended needs to return to that function, is the
reference to it in the stack enough to keep it from being collected?

#4 I'm trying to decide how to handle multitasking. I would like to try
cooperative multi-tasking, but in case a thread doesn't cooperate, I need a
way to make it yield control after a certain amount of time or a number of
operations. Are there any native or otherwise good ways to do this? I'm not
immensely worried about any one thread/pseudo-thread in my program hanging,
as long as I have a way to escape it.

----- Original Message -----
From: "Mark Hurd" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, August 08, 2005 7:52 AM
Subject: Re: [ADVANCED-DOTNET] DynamicMethod Class


Seeing as noone else has answered, I'll point out the boot.lisp in
DotLisp as an example of dynamic code (Rich Hickey's original calls
delegates, and my modification also calls single method interfaces)
that answers the second and third questions.

DotLisp project
http://dotlisp.sourceforge.net/

My extensions:
http://www.ozemail.com/~markhurd/DotLispPatch.html

For the first question, I don't know, but I think your discussion
effectively answers it, as 'no'. (And I think I've also seen something
related suggesting that the answer is no. Specifically it related to
avoiding JIT errors when referenced assemblies are not available.)

Regards,
Mark Hurd, B.Sc.(Ma.)(Hons.)

P.S:Warning gmail.com headers often cause replies to me when they are
intended for the mailing list.

On 8/7/05, Jonathan Ross <[EMAIL PROTECTED]> wrote:
I'm doing a project using DynamicMethods and have some questions. Note:
I'm not sure, but this may only be available in .NET 2.0.

#1 After I emit an instruction, is there any way for me to delete it or
otherwise modify it?

#2 DynamicMethods are static, but I would like to use them as if they
were instance methods. Does anyone have a good, efficient suggestion on
how to do this?

#3 This may go along with #2, but how do I reference an external
variable? For example, from my dynamic method, how can I check the value
of an integer in my program without using a function call to my program?
I want to reference it directly.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com


===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to