Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > "layout manager 15072a0 failed to progress..."

"layout manager 15072a0 failed to progress..."
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Aug 7, 2001, 07:14 PM
 
Okay, what the heck does this mean:

Aug 07 18:58:17 Primer[928] *** layout manager 15072a0 failed to progress beyond index 7765 while drawing glyphs.
I get this while executing a little java-cocoa app. It's suppose to find primes, which it will do up to a point, and then I get this drawing error and the program crashes. The way I have it set up, a user enters a number of primes to find, my main Object creates a thread that finds them one at a time and printing them to the screen in a NSTextView. It was actually working well without a thread, and even worked fine when I implemented threads incorrectly by calling run() instead of start() off my thread. I don't know how threading and this layout manager are related at all...

Any ideas?
Thanks,
F-bacher
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Aug 7, 2001, 07:20 PM
 
Oh, one more thing, it works fine if I just output the primes to a text file instead of the screen. The only calls my Thread method makes that relate to NSTextView are:

output.inserText(currentPrime);
and
output.displayIfNeeded();

Where output is my NSTextView object and currentPrime is the String object of a prime to print.

F-bacher
     
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status: Offline
Reply With Quote
Aug 8, 2001, 12:05 AM
 
Many objects in the AppKit are not thread safe. I don't know the exact cause of your error, but my best guess is that your worker thread is trying to insert text into the text view while the view is in the process of redisplaying the text from the previous insertion. There are several ways to deal with this, depending on how much work you want to do.

The simplest way would be to just wait until all the numbers are done being generated before outputting all of it to the text view. This does of course mean that you won't get to see progress being made, but it's a simple fix.

The harder way would be to set up an NSConnection between your two threads and send updates from your worker thread to the main thread. That way, your updates would be queued up in the main thread and you wouldn't have any race conditions.
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Pasadena, CA, USA
Status: Offline
Reply With Quote
Aug 8, 2001, 03:24 PM
 
You could probably just synchronize access to the java method you're using to set the NSTextField. So instead of

public void setTextField(String val)

You would have

public synchronised void setTextField(String val)

And the Java VM will make sure your threads don't clash calling this method.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2