Ok, i'm at home with a little more time on my hand.
I didn't manage to reproduce any gui blockage, though I managed to make it
very sluggish. I don't have shotwell so I did a little test script but my
tests were limited
so my first question is : What exactly do you see. Is it a complete gui
blockage, or is it just slugishness ? does the dt.gui.selection trick make
it completely responsive, or less sluggish ?
I'm not completely clear how you block the gtk thread, my guess is that you
don't but that somehow some lua is called on each redraw, and when your
process is running in a secondary thread, it blocks the lua lock which in
turn blocks the gtk thread trying to run lua code.
calling dt.gui.selection will force lua to run some code in the "real" gtk
thread. To do that, lua programs a task to be run in the gtk thread,
release the lua lock, and wait for the job on the gtk thread to do what it
has to do. So this call not only releases the lua lock, it also forces a
task switch
a very short sleep timer will release the lua lock, but take it immediately
before the scheduler can run another thread which would take the lock.
The core problem is that your main loop is a case I hadn't thought of. I
had thought of long-running shell scripts (darktable.control.execute)
waiting for some data to be availalbe on a socket or device
(darktable.control.read) or an infinite loop that sleeps for "a long time"
(darktable.control.sleep) I hadn't thought of a loop that makes most of its
processing in lua and tries to not sleep, but still need to release the
lock.
could you test if replacing your call to dt.gui.selection to a call to
dt.control.execute("true") also fixes your issue ?
if that helps, I will add a call to g_thread_yield at a strategic place in
dt.control.sleep and you will be able to call dt.control.sleep(0)
On Mon, Jan 30, 2017 at 5:51 PM, William Ferguson <[email protected]>
wrote:
> The command to build the lua api doc is make darktable-lua-api.
>
> I've attached a copy of the version 4 api manual.
>
> Regards,
>
> Bill
>
> On Mon, Jan 30, 2017 at 11:30 AM, jeremy rosen <
> [email protected]> wrote:
>
>> yeah... you can build it yourself with "make <something>" but i don't
>> remember what and i'm not at home right now...
>>
>> anyway, that explains your problems with coroutine.yield....
>>
>> On Mon, Jan 30, 2017 at 5:25 PM, René Seindal <[email protected]> wrote:
>>
>>> On 2017-01-30 17:11, jeremy rosen wrote:
>>>
>>>> Hey René
>>>>
>>>> what version of DT are you using ?
>>>>
>>>
>>> Darktable 2.2.1 from Debian testing. It should be Lua API 4.
>>>
>>> there has been lots of changes in the latest version
>>>>
>>>
>>> I've noticed :-)
>>>
>>> > and you should not be able to block the UI thread easily
>>>
>>>> anymore.
>>>>
>>>
>>> That has been fairly easy.
>>>
>>> You will, however, block all lua processing...
>>>>
>>>
>>> I have no idea how much of darktable is done in Lua, and what that would
>>> imply.
>>>
>>> Moreover, I just realized that the lua API on the DT webpage is
>>>> completely outdated, and the area you are looking at has changed
>>>> heavily....
>>>>
>>>
>>> It is for API v3. I haven't been able to find anything newer online.
>>>
>>>
>>>> I'll poste anotherr mail tonight when I am at home and have access to my
>>>> dev build...
>>>>
>>>
>>> Thanks.
>>>
>>>
>>>
>>> --
>>> René Seindal - [email protected]
>>>
>>
>>
>> ____________________________________________________________________________
>> darktable user mailing list to unsubscribe send a mail to
>> [email protected]
>>
>
>
> ____________________________________________________________________________
> darktable user mailing list to unsubscribe send a mail to
> [email protected]
>
____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to [email protected]