Re: gthreads and file operations



I got the problem!

The thing is, before calling the prepareGrammar() function i am calling a
function, SPI_generateMouseEvent() which modifies the at-spi tree which is
accessed by prepareGrammar, i.e., i was accessing the tree while it was
being modified by another external program. All i need to do is, delay
calling the prepareGrammar() function by 1 sec(or is there any other way??).

By the way, I had never programmed using glib threads before. Is the threads
part of the code I had sent earlier correct? or does it need any changes? I
also have to add GUI(a gnome panel applet) to my application. Would that
require a new thread?

Thanks for all the help so far. Sorry if I wasted your time.

On Tue, Apr 13, 2010 at 12:21 AM, Nischal Rao <rao nischal gmail com> wrote:

I just noticed... the code sometimes works and sometimes doesn't work(the
code doesn't go to completion which kind of confirms that there is thread
lock problem).

There doesn't seem to be an error in other parts of the code because the
code works fine when i comment the file writing part(i.e., prepareGrammar()
).

I have attached part of my code.

PS: I have used standard functions (fopen, fprintf etc) because i couldn't
find glib equivalent(for fseek() and fclose() ).


On Mon, Apr 12, 2010 at 10:52 PM, Tor Lillqvist <tml iki fi> wrote:

It would be *much* easier to help you if you could show us some actual
code that works strangely for you. A minimal but complete sample
program, thanks. Now it is very hard to understand what you mean.

--tml




--
regards,
Nischal E Rao
blogs.sun.com/nischal

Join RVCE OSUM at http://osum.sun.com/group/rvceosum




-- 
regards,
Nischal E Rao
blogs.sun.com/nischal

Join RVCE OSUM at http://osum.sun.com/group/rvceosum



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