Lisp HUG Maillist Archive

Drawing in the background and multiple threads

I'm of course aware that CAPI operations should always use
apply-in-pane-process or execute-with-interface in order to make sure
that things happen in the right thread.  However, the user guide only
says that "all operations on DISPLAYED CAPI elements need to be in the
thread that runs their interface."  (Emphasis mine.)

Am I right to assume that if I'm for example drawing to an output pane
which is NOT displayed and only used as a background buffer that I can
draw to it from whichever thread I like, presumably from several
threads at the same time?  Does anybody have experience with such an
approach?

Thanks,
Edi.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Drawing in the background and multiple threads

Hi Edi, et al,

That is what I do in our GigaDSP that you have seen demoed in Hamburg. I use backing stores and manage that myself. CAPI is completely unaware that I'm doing such things. I do use GP (Graphic Ports) during these operations.

- DM

On Jan 24, 2013, at 00:26 AM, Edi Weitz <edi@weitz.de> wrote:

> 
> I'm of course aware that CAPI operations should always use
> apply-in-pane-process or execute-with-interface in order to make sure
> that things happen in the right thread.  However, the user guide only
> says that "all operations on DISPLAYED CAPI elements need to be in the
> thread that runs their interface."  (Emphasis mine.)
> 
> Am I right to assume that if I'm for example drawing to an output pane
> which is NOT displayed and only used as a background buffer that I can
> draw to it from whichever thread I like, presumably from several
> threads at the same time?  Does anybody have experience with such an
> approach?
> 
> Thanks,
> Edi.
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 
> 

Dr. David McClain
CTO & Co-Founder
Acudora (TM)
e-mail: david@acudora.com
Tel: (+1) 520-529-2437




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Drawing in the background and multiple threads

Hi Edi,


On 24 janv. 2013, at 08:26, Edi Weitz <edi@weitz.de> wrote:

> Am I right to assume that if I'm for example drawing to an output pane
> which is NOT displayed and only used as a background buffer that I can
> draw to it from whichever thread I like, presumably from several
> threads at the same time?

Just my 2 cents…  I have never done such thing, but I am wondering if it wouldn't be needed to at least serialize access to the graphics-state, unless there is one graphics-state for each thread.


Best,
Cam


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Drawing in the background and multiple threads

David, Camille,

Thanks to you both.  I wasn't planning to manipulate the Graphics
State, so that won't be a problem.  Otherwise, it's good to hear that
you're also doing this and that it works.

Cheers,
Edi.


On Thu, Jan 24, 2013 at 7:25 PM, David McClain <david@acudora.com> wrote:
>
> ... so Yes, I believe Camille is correct. You need to exercise prudent multi-thread access if the state becomes shared across multiple threads.
>
> - DM
>
> On Jan 24, 2013, at 11:18 AM, David McClain <david@acudora.com> wrote:
>
>>
>> My understanding has been that the Graphics State belongs to individual Graphics Ports, not threads.
>>
>> - DM
>>
>> On Jan 24, 2013, at 11:03 AM, Camille Troillard <camille@osculator.net> wrote:
>>
>>>
>>> Hi Edi,
>>>
>>>
>>> On 24 janv. 2013, at 08:26, Edi Weitz <edi@weitz.de> wrote:
>>>
>>>> Am I right to assume that if I'm for example drawing to an output pane
>>>> which is NOT displayed and only used as a background buffer that I can
>>>> draw to it from whichever thread I like, presumably from several
>>>> threads at the same time?
>>>
>>> Just my 2 cents…  I have never done such thing, but I am wondering if it wouldn't be needed to at least serialize access to the graphics-state, unless there is one graphics-state for each thread.
>>>
>>>
>>> Best,
>>> Cam
>>>
>>>
>>> _______________________________________________
>>> Lisp Hug - the mailing list for LispWorks users
>>> lisp-hug@lispworks.com
>>> http://www.lispworks.com/support/lisp-hug.html
>>>
>>>
>>
>> Dr. David McClain
>> CTO & Co-Founder
>> Acudora (TM)
>> e-mail: david@acudora.com
>> Tel: (+1) 520-529-2437
>>
>>
>>
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html
>>
>>
>
> Dr. David McClain
> CTO & Co-Founder
> Acudora (TM)
> e-mail: david@acudora.com
> Tel: (+1) 520-529-2437
>
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Drawing in the background and multiple threads

If my program does nothing but drawing lines, all in the same color,
it doesn't manipulate the Graphics State, or does it?  It has to draw
a lot of small line segments, but nothing else - no transformations,
no colors, etc.

On Thu, Jan 24, 2013 at 8:26 PM, David McClain <david@acudora.com> wrote:
> Hi Edi,
>
> I don't know how you could hope to draw anything without manipulating the Graphics State of a Port? Such things as foreground and background colors, line stipple, coordinate transformations, etc -- all reflected in the Graphics State.
>
> - DM
>
> On Jan 24, 2013, at 12:19 PM, Edi Weitz <edi@agharta.de> wrote:
>
>> David, Camille,
>>
>> Thanks to you both.  I wasn't planning to manipulate the Graphics
>> State, so that won't be a problem.  Otherwise, it's good to hear that
>> you're also doing this and that it works.
>>
>> Cheers,
>> Edi.
>>
>>
>> On Thu, Jan 24, 2013 at 7:25 PM, David McClain <david@acudora.com> wrote:
>>>
>>> ... so Yes, I believe Camille is correct. You need to exercise prudent multi-thread access if the state becomes shared across multiple threads.
>>>
>>> - DM
>>>
>>> On Jan 24, 2013, at 11:18 AM, David McClain <david@acudora.com> wrote:
>>>
>>>>
>>>> My understanding has been that the Graphics State belongs to individual Graphics Ports, not threads.
>>>>
>>>> - DM
>>>>
>>>> On Jan 24, 2013, at 11:03 AM, Camille Troillard <camille@osculator.net> wrote:
>>>>
>>>>>
>>>>> Hi Edi,
>>>>>
>>>>>
>>>>> On 24 janv. 2013, at 08:26, Edi Weitz <edi@weitz.de> wrote:
>>>>>
>>>>>> Am I right to assume that if I'm for example drawing to an output pane
>>>>>> which is NOT displayed and only used as a background buffer that I can
>>>>>> draw to it from whichever thread I like, presumably from several
>>>>>> threads at the same time?
>>>>>
>>>>> Just my 2 cents…  I have never done such thing, but I am wondering if it wouldn't be needed to at least serialize access to the graphics-state, unless there is one graphics-state for each thread.
>>>>>
>>>>>
>>>>> Best,
>>>>> Cam
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Lisp Hug - the mailing list for LispWorks users
>>>>> lisp-hug@lispworks.com
>>>>> http://www.lispworks.com/support/lisp-hug.html
>>>>>
>>>>>
>>>>
>>>> Dr. David McClain
>>>> CTO & Co-Founder
>>>> Acudora (TM)
>>>> e-mail: david@acudora.com
>>>> Tel: (+1) 520-529-2437
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Lisp Hug - the mailing list for LispWorks users
>>>> lisp-hug@lispworks.com
>>>> http://www.lispworks.com/support/lisp-hug.html
>>>>
>>>>
>>>
>>> Dr. David McClain
>>> CTO & Co-Founder
>>> Acudora (TM)
>>> e-mail: david@acudora.com
>>> Tel: (+1) 520-529-2437
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Lisp Hug - the mailing list for LispWorks users
>>> lisp-hug@lispworks.com
>>> http://www.lispworks.com/support/lisp-hug.html
>>>
>
> Dr. David McClain
> CTO & Co-Founder
> Acudora (TM)
> e-mail: david@acudora.com
> Tel: (+1) 520-529-2437
>
>
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Drawing in the background and multiple threads

It really IS some kind of "turtle graphics" that I'm working on.
Another one of those demos for the students... :)


On Thu, Jan 24, 2013 at 10:50 PM, David McClain <david@acudora.com> wrote:
>
> Your description of what you want to do reminds me of the concurrent "Turtles" in early Smalltalk all drawing paths at the same time...
>
> - DM
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


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