On 16 Jan 2007, at 00:53, Quentin Mathé wrote:

ok, not sure it is worth the investment, eventually a method like - turnOnAutboxingIfThreaded may be added. I was just suggesting the developer can write a new method that takes care of wrapping the instrisic return value into an object. Then he would call this method when the object is used in a threaded fashion. For example:

Yes, that would be the easiest way of doing it.

Just by curiosity, do you have other ideas to support intrisic return?

I can parse the run time type information in the return value (I've already written some code to do this for the serialisation stuff) quite easily, but it is a bit messy if I automatically encapsulate it. Another option is to allow the intrinsic return mechanism to work as usual (with the current hackery so that it returns asynchronously), but provide some other out-of-band way of notifying the caller that the value was actually valid.

But sometimes I think it could be sufficient (and potentially more efficient than a real thread, not sure of this point though). For example you need to run a method that would block the main thread for one second (or half a second), having such coroutines is useful to eliminate tiny UI chockes that are very common. I would say that migrating such thread to a second core would be too expansive to present an interest, no?

The problem with co-routines is that they are co-operative. Thus, they require an explicit yield which means that co-routines + futures gives you exactly the same thing as a normal function call, but with more overhead.

ok. At some point, I will surely move it into EtoileFoundation.

Shiny. Nicolas and I were talking the other day about having a macros.h file somewhere that could be used for all Étoilé applications. He had some for quickly creating dictionaries and I had some for iterating over collections (a FOREACH macro semantically equivalent to the new for statement in Objective-C 2).

By the way, another thing that I was working on was serialisation of arbitrary objects. By inspecting the type information associated with each object, I have written code that will automatically serialise almost any arbitrary object with no input modifications (the exceptions are pointers to things other than classes, since the size of the allocation is not stored at runtime [1]). Still to do is the deserialisation code...

This seems really interesting, looking forward to it :-)

I'll add it Real Soon Now™…



_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to