Re: Fork and synchronous execution of child processes.

2010-09-05 Thread Henrik Sarvell
First of all, sorry for the confusion in my original post, I had just
been viewing code using (if (fork) ... ) a lot and saw an if instead
of the unless.

I think I got the situation from your answer, it's simply the Prg
after the fork that is being executed in the child. The unless is
needed to avoid the parent from executing the same body.

The problem with the task version not executing for me was that I
thought that running the code in (forkWorkHorse) wouldn't matter at
all, so my real call looked like this:

(de initiateUpdatePresentFeeds ()
   (boss 'forkWorkHorse 'updatePresentFeeds (lit (collect 'fid '+Feed

But I made it:

(de initiateUpdatePresentFeeds ()
   (boss 'updatePresentFeeds (lit (collect 'fid '+Feed

in my post to avoid confusion.

However, it does have an effect since the second call above works just
fine whereas the first does not.

This is what forkWorkHorse looks like:

(de forkWorkHorse Args
   (unless (fork)
  (eval Args)
  (bye)))

We discussed this one in IRC, it's really silly we both forgot the
purpose of it but I think it was created in order to be able to
execute member methods directly in the boss call, ie maybe:

(boss 'forkWorkHorse 'someMethod ''+SomeClass Args)




On Sat, Sep 4, 2010 at 9:30 PM, Alexander Burger a...@software-lab.de wrot=
e:
 Hi Henrik,

 I have no idea either, very weird. I also tested to simply pass (1 2 3
 4) and using your updatePresentFeed function, however I put (traceAll)
 at the top of updatePresentFeeds, this is what I get:

 =A0task : -1000 (0 Pid NIL Cycles 0 Feeds Feeds (cond ((nand Pid (kill

 'traceAll' doesn't help here very much, as it traces only Lisp-level
 functions which are not called here (except 'task' itself). You need to
 trace explicitly functions you are interested in, or set breakpoints.

 Anyway, does the posted code work on itself, if you just 'load' it into
 a ./dbg environment? That's how I tested it.


 Can you think of anything at all that might be interfering with the
 task execution, for instance running two servers/tasks listening on
 different ports at the same time in this very same parent?

 This should not matter.

 You could manually insert a breakpoint into the code to have it
 stop when the task is executed:

 =A0 =A0 =A0Cycles 0
 =A0 =A0 =A0Feeds Feeds
 =A0 =A0 =A0(! cond
 =A0 =A0 =A0 =A0 ((nand Pid (kill Pid 0))
 =A0 =A0 =A0 =A0 =A0 =A0(if (pop 'Feeds)

 This will cause it to stop just before the 'cond'. Then you can single
 step into the expression(s) to see what happens.

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: Fork and synchronous execution of child processes.

2010-09-04 Thread Alexander Burger
Hi Henrik,

 I have no idea either, very weird. I also tested to simply pass (1 2 3
 4) and using your updatePresentFeed function, however I put (traceAll)
 at the top of updatePresentFeeds, this is what I get:
 
  task : -1000 (0 Pid NIL Cycles 0 Feeds Feeds (cond ((nand Pid (kill

'traceAll' doesn't help here very much, as it traces only Lisp-level
functions which are not called here (except 'task' itself). You need to
trace explicitly functions you are interested in, or set breakpoints.

Anyway, does the posted code work on itself, if you just 'load' it into
a ./dbg environment? That's how I tested it.


 Can you think of anything at all that might be interfering with the
 task execution, for instance running two servers/tasks listening on
 different ports at the same time in this very same parent?

This should not matter.

You could manually insert a breakpoint into the code to have it
stop when the task is executed:

  Cycles 0
  Feeds Feeds
  (! cond
 ((nand Pid (kill Pid 0))
(if (pop 'Feeds)

This will cause it to stop just before the 'cond'. Then you can single
step into the expression(s) to see what happens.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe