octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44751] Failure to exit when running Octave in


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #44751] Failure to exit when running Octave in --no-gui mode
Date: Sat, 18 Apr 2015 03:52:31 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #46, bug #44751 (project octave):

Great!  This output:


MAIN> Waiting for link mutex to free...
LINK> _shutdown_confirm_result AFTER EMIT: -1
LINK> GOING INTO WAIT STATE, SIMULTANEOUS UNLOCK MUTEX
MAIN> closenow = 1
MAIN> Attempting to Awake process...


is what I was hoping to see.  The main thread is getting ahead of the
interpreter/link thread.  The main thread waits, the link goes to sleep and
frees the mutex.  Then main thread gets the lock and continues.

"I wonder if it might be linked to the fact that I am doing the tests from
within a VM that has been attributed a single core."

That's a possibility--if it is the case that because of the one core there is
a very short interval that is spent in one thread before switching to the
other.

"I also tried with patch 33690 and replacing 3000 by 1500 and... it works as
well! I don't observe a 1.5s delay though."

Ah, you're right.  There's no discernible delay because the main thread gets
the mutex lock after waiting just a few milliseconds.  But it does wait
properly when 1500 is specified, so that's good.  It's nice to have a full
understanding of that issue.

Well, I think we'll try setting up the link/main connection with a mutex and
lock() rather than tryLock(1500) and see how that goes.  Yes, we could print
out some kind of failure if the lock attempt fails after 1.5 seconds--it's
informative, I suppose, but dropping out of a comm protocol can put a system
in an odd state where things might not work right.  Shouldn't be any problems,
if there is then we'll address it.

I'm attaching a first proposal for a changeset.  You may treat it just like a
patch file and do not have to import it like a changeset.  Please try it out. 
I've also added similar handshaking for all the cross-thread transfers, those
being mainly the dialog boxes.  Those worked for you, but for reasons of the
inherent delay it takes a user to select an option.  The modifications should
now be consistent with what we just figured out.  Also test things like "demo
errordlg" to confirm that still works properly.

(file #33706)
    _______________________________________________________

Additional Item Attachment:

File name: octave-shutdown_lock_mutex-djs2015apr16.patch Size:13 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44751>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]