[Openmcl-devel] Confused about processes

Sven Van Caekenberghe sven at beta9.be
Sun Jan 18 07:37:16 PST 2004


On 18 Jan 2004, at 02:06, Gary Byers wrote:

> On Sat, 17 Jan 2004, Sven Van Caekenberghe wrote:
>
>> A couple of days ago I rewrote the bulk mailing functionality of our
>> web application into a seperate process, so that the mailing is spread
>> over 12 hours (to save bandwidth afterwards when people start reading
>> the HTML mail ;-).
>>
>> So what I do is spawn a process from the paserve handler that splits
>> the job in 12 parts, sleeping for 1 hour in between and then ends:
>> progress is reported by sending email to a specified email address. As
>> far as I can tell, everything went fine: all test mails and
>> confirmation mails were sent.
>>
>> The debugging web app shows the following process listing:
>>
>> (#<PROCESS execute-mailing(22) [exhausted] #x55A6946>
>>   #<PROCESS execute-mailing(20) [exhausted] #x5585D1E>
...

>>   #<PROCESS Initial(0) [Sleeping] #x50C8D5E>)
>>
>> Both 'execute-mail' process are ended but are still in an 'exhausted'
>> state - as far as I understand my own code, the function that was the
>> body of the process returned. What does this state mean ? Why is the
>> process still there ?
>
> Are the "execute-mailing" processes created via PROCESS-RUN-FUNCTION,
> or via MAKE-PROCESS/PROCESS-PRESET/PROCESS-ENABLE ?
>
> Do the "exhausted" processes respond to PROCESS-KILL ?

>> I tried to recreate this problem in a listener, but failed to do that 
>> -
>> since the server is (of course) still running, I can go in and try to
>> inspect the process, but I don't know what I should look for. Any 
>> ideas?

OK, I figured out why I failed to reproduce the problem in a plain 
image: I was using the PROCESS-RUN-FUNCTION from the ACL-COMPAT layer 
of paserve (from the 1.2.12c release on OpenMCL 0.13.6). That 
particular version of PROCESS-RUN-FUNCTION does work OK in the lastest 
CVS version of paserve (both on OpenMCL 0.14 and LispWorks 4.3, 
though).

Now looking at the implementation of PROCESS-RUN-FUNCTION in 
acl-mp-mcl.lisp (CVS version 1.1), I see that they are indeed use the 
MAKE-PROCESS/PROCESS-PRESET/PROCESS-ENABLE route. When I try this 
manually I can reproduce the error:

Welcome to OpenMCL Version (Beta: Darwin) 0.13.6!
? (defun count-to (n stream) (dotimes (i n) (print i stream)))
COUNT-TO
? (process-run-function "test" #'count-to 10 *standard-output*)
#<PROCESS test(2) [Enabled] #x52AC9EE>
?
0
1
2
...
9
:proc
1 :    external-process-watchdog  [Suspended]
0 : -> Initial      [Running]  (Active)
? (make-process "test")
#<PROCESS test(4) [exhausted] #x52AF746>
? (process-preset * #'count-to 10 *standard-output*)
#<PROCESS test(4) [Suspended] #x52AF746>
? (process-enable *)
(#<PROCESS Initial(0) [Suspended] #x50D124E> #<PROCESS test(4) 
[Enabled] #x52AF746>)
?
0
1
2
...
9
:proc
4 :    test         [exhausted]
1 :    external-process-watchdog  [Suspended]
0 : -> Initial      [Suspended]  (Active)
? (:kill 4)
? :proc
1 :    external-process-watchdog  [Suspended]
0 : -> Initial      [Suspended]  (Active)

Although the documentation says that PROCESS-RUN-FUNCTION and 
MAKE-PROCESS/PROCESS-PRESET/PROCESS-ENABLE do the same thing, the 
actual implementation in l1-processes is slighly more complicated to 
put it mildly ;-)

The above sequences *does* work as expected under OpenMCL 0.14-031220.

Sven




More information about the Openmcl-devel mailing list