Re: gthreads and file operations

2010-04-14 Thread Olivier Sessink
Nischal Rao wrote: is there any way to listen to signals without calling gtk_main() (which never returns) ? If so, then i ll be able to get rid of threads(happily!!) I am new to glib threads and gnome signals.. i have just been following examples that i found on the net. What kind of

Re: gthreads and file operations

2010-04-14 Thread Chris Vine
On Wed, 14 Apr 2010 10:01:15 +0530 Nischal Rao rao.nisc...@gmail.com wrote: Let me explain the entire scenario. I need to be listening to a socket for data from an external program. I do this using an infinite loop. Once i get the data, i call a function and after it returns I go back into

Re: gthreads and file operations

2010-04-13 Thread Olivier Sessink
Nischal Rao wrote: the sample code is: [..] your use of threading doesn't make sense. All your threads are within a lock, so you have three threads (main + two threads) but they can never execute any instructions in parallel, because they all wait for the global gdk lock. Everything you want to

Re: gthreads and file operations

2010-04-13 Thread Nischal Rao
is there any way to listen to signals without calling gtk_main() (which never returns) ? If so, then i ll be able to get rid of threads(happily!!) I am new to glib threads and gnome signals.. i have just been following examples that i found on the net. Please help me. My requirement is that i

Re: gthreads and file operations

2010-04-13 Thread Chris Vine
On Wed, 14 Apr 2010 00:13:38 +0530 Nischal Rao rao.nisc...@gmail.com wrote: is there any way to listen to signals without calling gtk_main() (which never returns) ? If so, then i ll be able to get rid of threads(happily!!) I am new to glib threads and gnome signals.. i have just been

Re: gthreads and file operations

2010-04-13 Thread Nischal Rao
Let me explain the entire scenario. I need to be listening to a socket for data from an external program. I do this using an infinite loop. Once i get the data, i call a function and after it returns I go back into infinite loop again. While all this is happening I also need to listen to some

gthreads and file operations

2010-04-12 Thread Nischal Rao
Hi, Within a gnome thread i need to read as well as write to a file. I tried using the regular fprintf() etc but they don't seem to work. Can somebody please help me out since I am new to gnome threads. Thanks in advance. -- regards, Nischal E Rao blogs.sun.com/nischal Join RVCE OSUM at

Re: gthreads and file operations

2010-04-12 Thread Nischal Rao
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.,

Re: gthreads and file operations

2010-04-12 Thread Nischal Rao
the problem still persists. :( my assumption was wrong On Tue, Apr 13, 2010 at 12:43 AM, Nischal Rao rao.nisc...@gmail.com wrote: I got the problem! The thing is, before calling the prepareGrammar() function i am calling a function, SPI_generateMouseEvent() which modifies the at-spi

Re: gthreads and file operations

2010-04-12 Thread Nader Morshed
Not sure if it's just me, but I can't see the attachment. For things like fseek and fclose, you might want to look at the gio library (http://library.gnome.org/devel/gio/stable/) which is included along with glib. On Tue, 13 Apr 2010 00:21:44 +0530 Nischal Rao rao.nisc...@gmail.com wrote: I