Lisp HUG Maillist Archive

Starting and stopping multiprocessing

Hello L-Hug,

I'm having some difficulty understanding how someone (1) dynamically
enables multi-threading on Lispworks.  It is also my understanding
that I will need to (2) disable multiprocessing before saving an
image.

With regards to (1), I have tried placing the call to
(mp:initialize-multiprocessing) inside my lisp script that gets
loaded, but the build appears to abort the script and then quit.
What's the correct way to tell Lispworks that I want an image that can
use multiprocessing?  Note that I'm using an image of Lispworks that I
created to run from a terminal, as opposed to within the GUI.

With regards to (2), how do I tell Lispworks to stop multiprocessing
so that I can successfully call save-image?

I suspect that I may only need (1) so that I can restart
multiprocessing from a previously already saved image.

Thanks,
David


Re: Starting and stopping multiprocessing

Hello Again,

I've partially answered my question about (1).  The answer was to save
an image that automatically starts multiprocessing, as follows:

(save-image "mp-lispworks"
:restart-function 'mp:initialize-multiprocessing)

One downside to this feature is that when I return from an error, it's
also possible to "return from multiprocessing", which is something I
would preferto disable in my application.  Is there a way to do that?

This leads me to a partial answer to my (2) question -- that I need to
find a way to tell Lispworks to "return from multiprocessing".

Thanks,
David

On Mon, Apr 4, 2011 at 4:51 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
> Hello L-Hug,
>
> I'm having some difficulty understanding how someone (1) dynamically
> enables multi-threading on Lispworks.  It is also my understanding
> that I will need to (2) disable multiprocessing before saving an
> image.
>
> With regards to (1), I have tried placing the call to
> (mp:initialize-multiprocessing) inside my lisp script that gets
> loaded, but the build appears to abort the script and then quit.
> What's the correct way to tell Lispworks that I want an image that can
> use multiprocessing?  Note that I'm using an image of Lispworks that I
> created to run from a terminal, as opposed to within the GUI.
>
> With regards to (2), how do I tell Lispworks to stop multiprocessing
> so that I can successfully call save-image?
>
> I suspect that I may only need (1) so that I can restart
> multiprocessing from a previously already saved image.
>
> Thanks,
> David
>


Re: Starting and stopping multiprocessing

Hello again,

I now know that calling mp::stop-multiprocessing works for (2).  So, I
think this thread is now closed.

David

On Mon, Apr 4, 2011 at 5:28 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
> Hello Again,
>
> I've partially answered my question about (1).  The answer was to save
> an image that automatically starts multiprocessing, as follows:
>
> (save-image "mp-lispworks"
> :restart-function 'mp:initialize-multiprocessing)
>
> One downside to this feature is that when I return from an error, it's
> also possible to "return from multiprocessing", which is something I
> would preferto disable in my application.  Is there a way to do that?
>
> This leads me to a partial answer to my (2) question -- that I need to
> find a way to tell Lispworks to "return from multiprocessing".
>
> Thanks,
> David
>
> On Mon, Apr 4, 2011 at 4:51 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
>> Hello L-Hug,
>>
>> I'm having some difficulty understanding how someone (1) dynamically
>> enables multi-threading on Lispworks.  It is also my understanding
>> that I will need to (2) disable multiprocessing before saving an
>> image.
>>
>> With regards to (1), I have tried placing the call to
>> (mp:initialize-multiprocessing) inside my lisp script that gets
>> loaded, but the build appears to abort the script and then quit.
>> What's the correct way to tell Lispworks that I want an image that can
>> use multiprocessing?  Note that I'm using an image of Lispworks that I
>> created to run from a terminal, as opposed to within the GUI.
>>
>> With regards to (2), how do I tell Lispworks to stop multiprocessing
>> so that I can successfully call save-image?
>>
>> I suspect that I may only need (1) so that I can restart
>> multiprocessing from a previously already saved image.
>>
>> Thanks,
>> David
>>
>


Re: Starting and stopping multiprocessing

Hi David,

Just to follow up on this, another way to save a multiprocessing image is
using the :multiprocessing t argument (as in
http://www.lispworks.com/documentation/lw60/LW/html/lw-177.htm):

(save-image "~/lw-console"
            :console t
            :multiprocessing t
            :environment nil)

We don't recommend stopping multiprocessing and then saving the image, because
any thread-specific data will be lost anyway (the threads aren't saved).  It
is better to build from an image without multiprocessing and start all of the
threads on startup.

Sorry, there is no switch to disable the "return from multiprocessing"
restart.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/


>>>>> On Tue, 5 Apr 2011 15:33:37 -0500, David L Rager said:
> 
> Hello again,
> 
> I now know that calling mp::stop-multiprocessing works for (2).  So, I
> think this thread is now closed.
> 
> David
> 
> On Mon, Apr 4, 2011 at 5:28 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
> > Hello Again,
> >
> > I've partially answered my question about (1).  The answer was to save
> > an image that automatically starts multiprocessing, as follows:
> >
> > (save-image "mp-lispworks"
> > :restart-function 'mp:initialize-multiprocessing)
> >
> > One downside to this feature is that when I return from an error, it's
> > also possible to "return from multiprocessing", which is something I
> > would preferto disable in my application.  Is there a way to do that?
> >
> > This leads me to a partial answer to my (2) question -- that I need to
> > find a way to tell Lispworks to "return from multiprocessing".
> >
> > Thanks,
> > David
> >
> > On Mon, Apr 4, 2011 at 4:51 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
> >> Hello L-Hug,
> >>
> >> I'm having some difficulty understanding how someone (1) dynamically
> >> enables multi-threading on Lispworks.  It is also my understanding
> >> that I will need to (2) disable multiprocessing before saving an
> >> image.
> >>
> >> With regards to (1), I have tried placing the call to
> >> (mp:initialize-multiprocessing) inside my lisp script that gets
> >> loaded, but the build appears to abort the script and then quit.
> >> What's the correct way to tell Lispworks that I want an image that can
> >> use multiprocessing?  Note that I'm using an image of Lispworks that I
> >> created to run from a terminal, as opposed to within the GUI.
> >>
> >> With regards to (2), how do I tell Lispworks to stop multiprocessing
> >> so that I can successfully call save-image?
> >>
> >> I suspect that I may only need (1) so that I can restart
> >> multiprocessing from a previously already saved image.
> >>
> >> Thanks,
> >> David
> >>
> >
> 


Re: Starting and stopping multiprocessing

How do I get off this mailing list please?

--- On Wed, 4/6/11, Martin Simmons <martin@lispworks.com> wrote:

From: Martin Simmons <martin@lispworks.com>
Subject: Re: [Lisp-hug] Starting and stopping multiprocessing
To: lisp-hug@lispworks.com
Date: Wednesday, April 6, 2011, 12:33 PM


Hi David,

Just to follow up on this, another way to save a multiprocessing image is
using the :multiprocessing t argument (as in
http://www.lispworks.com/documentation/lw60/LW/html/lw-177.htm):

(save-image "~/lw-console"
            :console t
            :multiprocessing t
            :environment nil)

We don't recommend stopping multiprocessing and then saving the image, because
any thread-specific data will be lost anyway (the threads aren't saved).  It
is better to build from an image without multiprocessing and start all of the
threads on startup.

Sorry, there is no switch to disable the "return from multiprocessing"
restart.

--
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/


>>>>> On Tue, 5 Apr 2011 15:33:37 -0500, David L Rager said:
>
> Hello again,
>
> I now know that calling mp::stop-multiprocessing works for (2).  So, I
> think this thread is now closed.
>
> David
>
> On Mon, Apr 4, 2011 at 5:28 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
> > Hello Again,
> >
> > I've partially answered my question about (1).  The answer was to save
> > an image that automatically starts multiprocessing, as follows:
> >
> > (save-image "mp-lispworks"
> > :restart-function 'mp:initialize-multiprocessing)
> >
> > One downside to this feature is that when I return from an error, it's
> > also possible to "return from multiprocessing", which is something I
> > would preferto disable in my application.  Is there a way to do that?
> >
> > This leads me to a partial answer to my (2) question -- that I need to
> > find a way to tell Lispworks to "return from multiprocessing".
> >
> > Thanks,
> > David
> >
> > On Mon, Apr 4, 2011 at 4:51 PM, David L. Rager <ragerdl@cs.utexas.edu> wrote:
> >> Hello L-Hug,
> >>
> >> I'm having some difficulty understanding how someone (1) dynamically
> >> enables multi-threading on Lispworks.  It is also my understanding
> >> that I will need to (2) disable multiprocessing before saving an
> >> image.
> >>
> >> With regards to (1), I have tried placing the call to
> >> (mp:initialize-multiprocessing) inside my lisp script that gets
> >> loaded, but the build appears to abort the script and then quit.
> >> What's the correct way to tell Lispworks that I want an image that can
> >> use multiprocessing?  Note that I'm using an image of Lispworks that I
> >> created to run from a terminal, as opposed to within the GUI.
> >>
> >> With regards to (2), how do I tell Lispworks to stop multiprocessing
> >> so that I can successfully call save-image?
> >>
> >> I suspect that I may only need (1) so that I can restart
> >> multiprocessing from a previously already saved image.
> >>
> >> Thanks,
> >> David
> >>
> >
>

Updated at: 2020-12-10 08:38 UTC