Author Topic: Semaphore message  (Read 755 times)

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1717
Semaphore message
« on: April 25, 2018, 06:52:57 PM »
I hope someone can point me in the right direction, as I can't work out why I'm getting these messages; as they don't appear to stop my script running.

I’m running the latest Lua experimental version on my EOS(M).

Cheers

Garry




garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1717
Re: Semaphore message
« Reply #1 on: April 26, 2018, 02:20:27 PM »
I appreciate my previous post is rather unstructured.

The bottom line is: how could I narrow down the part of my script, and when, that is generating the semaphore message; when I don't have QEMU?

Cheers

Garry

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1717
Re: Semaphore message
« Reply #2 on: April 27, 2018, 01:45:44 PM »
@dmilligan

I reminded myself of the education you gave me here: https://www.magiclantern.fm/forum/index.php?topic=16677.msg162535#msg162535

You also hinted at a few ideas:

Quote
There are a couple of things I might could do with the backend that might help some of this:
1. More info about the semaphore timeout (like what CBR it was that was trying to execute, and what was blocking it)
2. Long running API calls (like camera.shoot) should "give" the semaphore while they are executing.


Bottom line: I will have another look at my code to see if I can minimise the semaphore timeouts, but I also will stop 'worrying' about them ;-)

Cheers

Garry

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: Semaphore message
« Reply #3 on: May 02, 2018, 01:00:59 AM »
The real solution is a proper multithreading implementation in lua. Alas, that remains rather elusive.

It does appear your issue is coming from a menu update callback. It’s either too slow, you have too many of them, or your script is busy doing something else when the menu backend calls the update.

It might help to post your script.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1717
Re: Semaphore message
« Reply #4 on: May 02, 2018, 01:54:59 AM »
@dmilligan

This isn’t the exact script, but it’s 99% close: https://gist.github.com/pigeonhill/cd1dbe0191ca1264fc0aa07aaafb515d

BTW one project I have is to rewrite this script, as my coding is a little better now;-)

Cheers

Garry