Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
NCI and callback functions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stephane Peiry  
View profile  
 More options Sep 4 2004, 10:38 am
Newsgroups: perl.perl6.internals
From: steph...@modxml.org (Stephane Peiry)
Date: Sat, 4 Sep 2004 16:38:28 +0200
Local: Sat, Sep 4 2004 10:38 am
Subject: Re: NCI and callback functions

Well, still about getting callbacks to work on GTK, thaught that before
going for this:

On Tue, Aug 24, 2004 at 09:44:56AM +0200, Leopold Toetsch wrote:
> >Otherwise, already thaught of actually unrolling the gtk_main function
> >and have it handled/implemented within parrot directly (mainly gtk_main
> >simply loops and waits on the gtk event queue).

> That's the way to go.

giving a try to the idea of "putting gtk_main on its own thread" would
be worth.. unless theres a thourough warning with a "dont do that" msg
in it?

Attached is the a really "quick hack" that uses nci again to actually
start gtk_main on its own thread, rather than calling it directly and
this works nicelly for what I tested :)

The only issue I see atm is if parrot wants to call the callback it-
self while in the "waiting for callback loop", mean it would run into
some race conditions if for some reasons parrot invokes the callback,
and somebody triggers the callback via gtk..?

While thinking about this, isnt the current callback implementation
having this issue, or how does it handle this?  say if the callback
function increments an int value passed in and then prints it, it
should always print 1 (if 0 was passed) whereas afaik it might
sometimes print 0 or 2 (depending on when the external lib and
parrot would be calling in).

Is this dealt with explicitly?  ie. parrot executing a function (the
callback) in a single go? Or is it meant to be up to the programmer,
like "you shouldnt call it yourself", or lock your data or else?
Thanks,
Stéphane

  gtk.callbacks.tar.gz
1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Sep 6 2004, 4:40 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 6 Sep 2004 10:40:28 +0200
Local: Mon, Sep 6 2004 4:40 am
Subject: Re: NCI and callback functions

Stephane Peiry <steph...@modxml.org> wrote:
> The only issue I see atm is if parrot wants to call the callback it-
> self while in the "waiting for callback loop", mean it would run into
> some race conditions if for some reasons parrot invokes the callback,
> and somebody triggers the callback via gtk..?

If the run loop is calling the callback too, you have to provide
synchronization.

> Is this dealt with explicitly?  ie. parrot executing a function (the
> callback) in a single go?

No. A callback or any other event function can be interrupted in the
current implementation.

> ... Or is it meant to be up to the programmer,
> like "you shouldnt call it yourself", or lock your data or else?

Yep.

> Thanks,
> Stéphane

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »