Cancel
Showing results for 
Search instead for 
Did you mean: 

Temporary deadlock while updating UDF from BlockStyler dialog

Phenom
Phenom

What I have:

  • BlockStyler dialog with a Double value on it shown as a scale
  • Some arrow buttons that change the value of the Double by a known increment
  • When either the Scale handle is dragged or the arrow buttons are clicked a UDF's parameter is changed according to the Double value

The problem:

The users tend to want to click the arrow buttons repeatedly, not waiting for each UDF update to complete. When this repeated clicking is too rapid, NX seems to get into some sort of deadlock and nothing happens for a while. Sometimes the deadlock is around 30 seconds, sometimes 3 or 4 minutes. Then the model update continues and everything is OK.

 

I have no idea why the deadlock occurs, but I've been trying to stop it happening. Things I've tried:

  • When the user clicks an arrow button, before I do the UDF update, disable the arrow buttons so he/she should not be able to click again. Do the UDF update and then enable the arrow buttons again.
  • Add some sleep calls to the above process to see if this helps prevent extra clicks
  • Use a stopwatch object to check the amount of time since the last click and prevent clicks that are too close together
  • Put in print statements to see when the deadlock occurs

Eventually the print statements seem to show that the following happens:

  1. User clicks an arrow button
  2. The callback method is executed
  3. Arrow button is disabled
  4. A UDF update is initiated
  5. User clicks an arrow button
  6. The callback method is not executed again at this point, but the deadlock occurs

So it looks like something in the NX BlockStyler dialog is seeing the users click on the arrow button while the UDF update is happening and confusing the whole process.

 

Any other ideas what I can try to avoid this?

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5
2 REPLIES

Re: Temporary deadlock while updating UDF from BlockStyler dialog

Phenom
Phenom

Even more bizarrely, I think I've found a way to break the deadlock.

While NX is in deadlock, if I make certain other windows active, it seems to break the deadlock Man Surprised

Lotus Notes seems to do it, and Chrome. So at least I have something to tell the users Man LOL

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Temporary deadlock while updating UDF from BlockStyler dialog

Phenom
Phenom

Even more bizzarely I think I can use ANY window to clear it.

If I hide the arrow button behind another window the deadlock is cleared Man Frustrated

I'll try and record a video showing what happens....

See video here

The quality is a bit crappy, but you'll get the idea.

This release of the deadlock is completely reproducable. Very strange indeed.

 

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5