problems with synchronization of threads in updating a text buffer in gtk2.0



 Hi all,
  I am working on developing a gui for my application which runs many posix threads. These threads will try 
to update the text view by adding text. this is how the i have written the code 
  
  gtk_text_buffer_get_bounds(buffer,&start,&end);
   gtk_text_buffer_insert(buffer,&end,printbuffer,strlen(printbuffer));
  
  Some times i get 
  
  Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion `layout->wrap_loop_count == 0' failed
  
  Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the 
characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
  You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
  You can apply tags and insert marks without invalidating your iterators,
  but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character 
offset)
  will invalidate all outstanding iterators
  
  After some searching i found that this due to some threading issue with gtk. I also used g_thread_init () 
and gdk_threads_init() , gdk_thread_leave and gdk_thread_enter as specified in the following link,
  
  http://mail.gnome.org/archives/gtk-a.../msg00086.html
  
   this works but this slows down my updation of the MMI quite considerably which i dont want.
  
  Is there any other alternative for this or if some one has worked on the following lines before and has got 
it to work please let me know. Cos this is very urgent.
  
  Regards
  S.Suresh Stephen


There aint no success without failure , nor victory without Sacrifice 

A HERO never chooses his DESTINY , instead it is DESTINY which chooses HIM .

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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