Interesting problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Interesting problem

Luca Bruno aka Lethalman
(first sorry for my poor English)

Hello,
i'm trying to solve problems with GObject signals but everytime i get  
something not working as well.
Actually, i have a threaded gtk main loop. Since callbacks have return  
values, and also because i have to wait before the squeak side callback  
finish its work, i wait with something like a lock:

while (callback->locked != 0);

Now, Squeak process and the main loop are two different OS level threads.  
When a callback is called it's registered into a queue and a semaphore is  
signaled, Squeak then checks for callbacks and run them. In the while, the  
C callback idles until callback->locked is 1. This works as well when the  
signal is dispatched from the main loop thread, when it's dispatched from  
Squeak it blocks everything.
What's the best way to handle this kind of problem? I tried to look at  
wxSqueak but i really didn't realize how they solved this problem.

Hoping for a reply, thanks you all.

--
www.lethalman.net - Thoughts about internet technologies

Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

stéphane ducasse-2
> (first sorry for my poor English)
No problem :L) mine is bad too :)
I read your blog :)

> Hello,
> i'm trying to solve problems with GObject signals but everytime i  
> get something not working as well.

What is a GObject

> Actually, i have a threaded gtk main loop. Since callbacks have  
> return values, and also because i have to wait before the squeak  
> side callback finish its work, i wait with something like a lock:
>
> while (callback->locked != 0);
>
> Now, Squeak process and the main loop are two different OS level  
> threads. When a callback is called it's registered into a queue and  
> a semaphore is signaled, Squeak then checks for callbacks and run  
> them. In the while, the C callback idles until callback->locked is  
> 1. This works as well when the signal is dispatched from the main  
> loop thread, when it's dispatched from Squeak it blocks everything.
> What's the best way to handle this kind of problem? I tried to look  
> at wxSqueak but i really didn't realize how they solved this problem.
>
> Hoping for a reply, thanks you all.
>
> --
> www.lethalman.net - Thoughts about internet technologies
>


Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

Luca Bruno aka Lethalman
GObject is the base object fo rall Gtk objects, however i solved using
setjmp/longjmp as wxSqueak do.

On 6/17/06, stéphane ducasse <[hidden email]> wrote:

> > (first sorry for my poor English)
> No problem :L) mine is bad too :)
> I read your blog :)
>
> > Hello,
> > i'm trying to solve problems with GObject signals but everytime i
> > get something not working as well.
>
> What is a GObject
>
> > Actually, i have a threaded gtk main loop. Since callbacks have
> > return values, and also because i have to wait before the squeak
> > side callback finish its work, i wait with something like a lock:
> >
> > while (callback->locked != 0);
> >
> > Now, Squeak process and the main loop are two different OS level
> > threads. When a callback is called it's registered into a queue and
> > a semaphore is signaled, Squeak then checks for callbacks and run
> > them. In the while, the C callback idles until callback->locked is
> > 1. This works as well when the signal is dispatched from the main
> > loop thread, when it's dispatched from Squeak it blocks everything.
> > What's the best way to handle this kind of problem? I tried to look
> > at wxSqueak but i really didn't realize how they solved this problem.
> >
> > Hoping for a reply, thanks you all.
> >
> > --
> > www.lethalman.net - Thoughts about internet technologies
> >
>
>
>


--
www.lethalman.net - Thoughts about computer technologies
squeakgtk.pbwiki.com - Searching for developers for Gtk on Smalltalk Squeak

Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

Rob Gayvert
You should take a look at some recent VM changes that Andreas has proposed:
 
http://discuss.squeakfoundation.org/cgi-bin/ezmlm-browse?list=vm-dev&cmd=showmsg&msgnum=749

I've switched over to this for wxSqueak, and it's working well.

.. Rob

Lethalman wrote:

> GObject is the base object fo rall Gtk objects, however i solved using
> setjmp/longjmp as wxSqueak do.
>
> On 6/17/06, stéphane ducasse <[hidden email]> wrote:
>
>> > (first sorry for my poor English)
>> No problem :L) mine is bad too :)
>> I read your blog :)
>>
>> > Hello,
>> > i'm trying to solve problems with GObject signals but everytime i
>> > get something not working as well.
>>
>> What is a GObject
>>
>> > Actually, i have a threaded gtk main loop. Since callbacks have
>> > return values, and also because i have to wait before the squeak
>> > side callback finish its work, i wait with something like a lock:
>> >
>> > while (callback->locked != 0);
>> >
>> > Now, Squeak process and the main loop are two different OS level
>> > threads. When a callback is called it's registered into a queue and
>> > a semaphore is signaled, Squeak then checks for callbacks and run
>> > them. In the while, the C callback idles until callback->locked is
>> > 1. This works as well when the signal is dispatched from the main
>> > loop thread, when it's dispatched from Squeak it blocks everything.
>> > What's the best way to handle this kind of problem? I tried to look
>> > at wxSqueak but i really didn't realize how they solved this problem.
>> >
>> > Hoping for a reply, thanks you all.
>> >
>> > --
>> > www.lethalman.net - Thoughts about internet technologies
>> >
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

Luca Bruno aka Lethalman
On Mon, 19 Jun 2006 17:38:46 +0200, Rob Gayvert <[hidden email]>  
wrote:

Thanks, are these changes official for the next release?

> You should take a look at some recent VM changes that Andreas has  
> proposed:
>  
> http://discuss.squeakfoundation.org/cgi-bin/ezmlm-browse?list=vm-dev&cmd=showmsg&msgnum=749
>
> I've switched over to this for wxSqueak, and it's working well.
>
> .. Rob
>
> Lethalman wrote:
>> GObject is the base object fo rall Gtk objects, however i solved using
>> setjmp/longjmp as wxSqueak do.
>>  On 6/17/06, stéphane ducasse <[hidden email]> wrote:
>>
>>> > (first sorry for my poor English)
>>> No problem :L) mine is bad too :)
>>> I read your blog :)
>>>
>>> > Hello,
>>> > i'm trying to solve problems with GObject signals but everytime i
>>> > get something not working as well.
>>>
>>> What is a GObject
>>>
>>> > Actually, i have a threaded gtk main loop. Since callbacks have
>>> > return values, and also because i have to wait before the squeak
>>> > side callback finish its work, i wait with something like a lock:
>>> >
>>> > while (callback->locked != 0);
>>> >
>>> > Now, Squeak process and the main loop are two different OS level
>>> > threads. When a callback is called it's registered into a queue and
>>> > a semaphore is signaled, Squeak then checks for callbacks and run
>>> > them. In the while, the C callback idles until callback->locked is
>>> > 1. This works as well when the signal is dispatched from the main
>>> > loop thread, when it's dispatched from Squeak it blocks everything.
>>> > What's the best way to handle this kind of problem? I tried to look
>>> > at wxSqueak but i really didn't realize how they solved this problem.
>>> >
>>> > Hoping for a reply, thanks you all.
>>> >
>>> > --
>>> > www.lethalman.net - Thoughts about internet technologies
>>> >
>>>
>>>
>>>
>>
>
>



--
www.lethalman.net - Thoughts about internet technologies

Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

timrowledge

On 19-Jun-06, at 12:34 PM, Bruno Luca wrote:

> On Mon, 19 Jun 2006 17:38:46 +0200, Rob Gayvert  
> <[hidden email]> wrote:
>
> Thanks, are these changes official for the next release?
Not yet. I haven't had time to evaluate them and include in VMMaker  
as yet.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: RCS: Read Card Sideways



Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

Luca Bruno aka Lethalman
On Mon, 19 Jun 2006 21:54:01 +0200, tim Rowledge <[hidden email]> wrote:

Ok, i'll switch once this will be official, thanks.

>
> On 19-Jun-06, at 12:34 PM, Bruno Luca wrote:
>
>> On Mon, 19 Jun 2006 17:38:46 +0200, Rob Gayvert <[hidden email]>  
>> wrote:
>>
>> Thanks, are these changes official for the next release?
> Not yet. I haven't had time to evaluate them and include in VMMaker as  
> yet.
>
> tim
> --
> tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> Strange OpCodes: RCS: Read Card Sideways
>
>
>



--
www.lethalman.net - Thoughts about internet technologies

Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

timrowledge

On 20-Jun-06, at 1:10 AM, Bruno Luca wrote:

> On Mon, 19 Jun 2006 21:54:01 +0200, tim Rowledge <[hidden email]>  
> wrote:
>
> Ok, i'll switch once this will be official, thanks.
My busyness shouldn't stop you from trying out the proposed changes  
and evaluating them and letting us know how good or bad you find them  
to be. Assuming of course that you aren't as swamped as I am...


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Couldn't find his way through a maze even if  
the rats helped him.



Reply | Threaded
Open this post in threaded view
|

Re: Interesting problem

Luca Bruno aka Lethalman
On Tue, 20 Jun 2006 17:05:09 +0200, tim Rowledge <[hidden email]> wrote:

I'm still fixing some squeak-side nested callback issues then i don't care  
of this currently.
Maybe in a second time...

>
> On 20-Jun-06, at 1:10 AM, Bruno Luca wrote:
>
>> On Mon, 19 Jun 2006 21:54:01 +0200, tim Rowledge <[hidden email]>  
>> wrote:
>>
>> Ok, i'll switch once this will be official, thanks.
> My busyness shouldn't stop you from trying out the proposed changes and  
> evaluating them and letting us know how good or bad you find them to be.  
> Assuming of course that you aren't as swamped as I am...
>
>
> tim
> --
> tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> Useful random insult:- Couldn't find his way through a maze even if the  
> rats helped him.
>
>
>



--
www.lethalman.net - Thoughts about internet technologies