On Mon, Feb 04, 2002 at 05:59:55PM +0100, Stefan Bodewig wrote: > On Mon, 4 Feb 2002, Scott Sanders <[EMAIL PROTECTED]> wrote: > > On Mon, Feb 04, 2002 at 05:30:35PM +0100, Stefan Bodewig wrote: > >> On Mon, 4 Feb 2002, Scott Sanders <[EMAIL PROTECTED]> wrote: > >> > >> > So, I only need to watch messages, and put them in the right > >> > task? > >> > >> Well, yes. Each message comes with the task instance as part of > >> the BuildEvent, so you can pile the messages up on a task by task > >> basis (this is what the current XmlLogger does AFAIK). > >> > > > > Cool. Well building up a string on a task by task basis is still > > less memory-consuming than DOM. I will give it a try. > > Be aware, that parallel is a task itself, so you have a taskStarted > event for parallel followed by taskStarted and taskEnded events for > all the nested tasks (in more or less random order, but you can rely > on taskStarted being called before any call to messageLogged and that > taskFinished will be the last call for each individual task) and > finally taskFinished for the parallel task. >
OK > > What I meant was, if I see the taskStarted() come by and it was the > > parallel task, could I become 'parallel-aware' then, and then > > default back to the single-threaded, less consuming model after > > taskFinished()? > > No, because somebody else could write a task container that did the > same as well. Maybe you could become "parallel aware" as soon as a > taskStarted gets fired for something that is instanceof TaskContainer. > So if the task is instanceof TaskContainer, then I *can* become parallel aware? > There is one thing, that adds another level of complexity here, sorry > ;-), you can nest any task into <parallel> including <ant>, which > means you can even get buildStarted and targetStarted events while you > are logging different messages for the "normal" tasks that are also > children of the parallel task. > So, parallel can call ant, which could call parallel, which could call ant...? That is OK, that just means that the parallel aware code also has to be stack aware in some sense. I will give it a try. Thanks, Scott > Stefan > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
