harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [vmi] thread library
Date Mon, 29 Jan 2007 14:05:23 GMT
Ronald Servant wrote:
> On 1/25/07, Tim Ellison <t.p.ellison@gmail.com> wrote:
> [SNIP]
>> The same thought came to me soon after posting; there is a dependency on
>> threadlib from the portlib, and the portlib functions don't get a
>> reference that can reach 'back' to the VMI struct.
>> So while it may be apparent in the launcher, it would be equally
>> apparent in the portlib functions themselves, since they would have no
>> reachable threadlib.
>> So maybe, as you say, we need to make the threadlib functions an
>> extension of the current portlib function table rather than the VMI
>> struct, and have them provided by a DLL loaded by the VM (and the thread
>> function table populated in the portlib initialization code).
> Making the threadLib functions an extension of the portLib function
> table seems a little odd to me.  IMHO it implies that the components
> portLib and threadLib are being provide together.  When in fact the
> portLib is Harmony code and the threadLib is a per VM implementation.

I was looking at it differently.  The portlib functions and the
threadlib functions are both internal portability APIs for the class
library / VM code.  So as a consumer of those APIs, one could consider
the threadlib as an extension of the portlib's functionality.

I agree that from a VMI implementer's point of view, they sit at
different sides of the 'provider line'.

>> Any other options?
> We could pass in an initialized threadLibrary into the portLibrary
> initialization functions -OR-  we could, as mentioned above have the
> portLibrary do the initialization of the thread Library -OR- a mix of
> both (pass in a null for threadLibrary means please create one). We
> could then add a function to the portLibrary that would return the
> threadLibrary function table. In either case, I don't see the thread
> functions being a part of the same table as the port functions.

Can you expand on these, I don't follow who 'we' are in each case.  In
each case, however, the Harmony code will need to call into the VM to
get the thread library function table, right?  The question for me is
then, how do the portlib functions get a reference to the threadlib

> This would also allow us to provide the vmi get thread library
> function by using the portLibrary.

I think the VMI will need a function for getting the threadlib from the
VM.  As you said above, we can provide a default if there is non
returned (like I suggested for the portlib a while ago).

> I am working on a patch to implement this now with the IBM VME, I hope
> to make it available for review/evaluation early next week.

Ok, but please share your ideas before polishing the code so we can all
see the direction you are proposing.  Code is good.


View raw message