🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #118644

Re: [Pan] Pan for Windows beta is finally here!!

#118644
From: Mark Derricutt
Date: Fri, 17 Jan 2003 23:21
93 lines
4360 bytes
On Fri, 17 Jan 2003 07:28:23 +0000, biggeordie wrote:

> On Fri, 17 Jan 2003 07:13:46 GMT Elmo Glick paraphrased the following:
>> 
>> Same experience here.  The author admits he's only tried in on 98, but
>> he's looking for a Win2k/XP box to troubleshoot it.
>> 
> I read that, I hope Charles does get a hold of XP to try and sort it out.

Couldn't see this in the webarchive so pasted here:

From: Charles Kerr <charles@rebelbase.com>
To: pan-devel@mail.freesoftware.fsf.org
Subject: [Pan-devel] Possible progress on the windows port...
Date-Sent: Thursday, January 16, 2003 15:52:51 -0800

The console output from beta 3 looks like Pan is making it to gtk_main(),
where it's blocking forever.  About 20 lines into gtk_main() in gtk 2.2,
this code shows up:

>  if (g_main_loop_is_running (main_loops->data))
>    {
>      GDK_THREADS_LEAVE ();
>      g_main_loop_run (loop);
>      GDK_THREADS_ENTER ();
>      gdk_flush ();
>    }

GDK is the drawing library bundled with GTK.
GDK_THREADS_LEAVE / GDK_THREADS_ENTER is used to unlock/lock the gui
drawing mutex.  mutexes are defined in glib, which uses CriticalSections
on newer versions of Windows, so on the platforms locking up this
more-or-less reads:

>  if (g_main_loop_is_running (main_loops->data))
>    {
>      EnterCriticalSection (gdk_gui_lock);
>      g_main_loop_run (loop);
>      LeaveCriticalSection (gdk_gui_lock);
>      gdk_flush ();
>    }

However, since Pan hasn't entered a critical section yet.
This is a problem, according to msdn:

>  If a thread calls LeaveCriticalSection when it does not have ownership of
>  the specified critical section object, an error occurs that may cause another
>  thread using EnterCriticalSection to wait indefinitely.

Sound familiar?
This sounds very much like what we're seeing in Pan on Windows... :)

And in fact the GTK FAQ is explicit about just this point, that threaded
apps must call gdk_threads_enter() before calling gtk_main()
http://www.gtk.org/faq/#AEN462

>  A minimal main program for a threaded GTK+ application looks like:
>  
>  int
>  main (int argc, char *argv>  [])
>  {
>    GtkWidget *window;
>  
>    g_thread_init(NULL);
>    gtk_init(&argc, &argv);
>  
>    window = create_window();
>    gtk_widget_show(window);
>  
>    gdk_threads_enter();
>    gtk_main();
>    gdk_threads_leave();
>  
>    return(0);
>  }

Though it's been a threaded app for years, Pan's never wrapped gtk_main()
with these.  And it doesn't seem to be a problem except for on Windows. d'oh!

So tonight I'll fire up cygwin/mingw and build a new Windows beta.
I'll also try to finalize the building-pan-on-windows HOWTO.

cheers,
Charles


_______________________________________________
Pan-devel mailing list
Pan-devel@nongnu.org
http://mail.nongnu.org/mailman/listinfo/pan-devel


Technical Details
Message-ID: <381F07E0D7A18607.B4CF28D15F25E183.63743D806A9D5DC5@lp.airnews.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal12.airnews.net!usenet
References: <tvas1v44qh723qn2c6tpeb39qf3n4dk0c8@4ax.com> <lvapiqq0d4rh.nijkjf03g6uj.dlg@40tude.net> <Xns92FF4C1F6FE6Bxs11eyahoocom@68.12.19.6> <Xns9303B6F978E37Elmoglickcom@24.94.165.86> <eV6V9.3880$ow3.33716366@news-text.cableinet.net> <Xns9306C5151212Elmoglickcom@24.94.165.86> <rgOV9.6728$kV.54312027@news-text.cableinet.net>

Show Full Headers
Complete Article Headers
Message-ID: <381F07E0D7A18607.B4CF28D15F25E183.63743D806A9D5DC5@lp.airnews.net>
Subject: Re: [Pan] Pan for Windows beta is finally here!!
Date: Sat, 18 Jan 2003 12:21:15 +1300
From: "Mark Derricutt" <mark@talios.com>
References: <tvas1v44qh723qn2c6tpeb39qf3n4dk0c8@4ax.com> <lvapiqq0d4rh.nijkjf03g6uj.dlg@40tude.net> <Xns92FF4C1F6FE6Bxs11eyahoocom@68.12.19.6> <Xns9303B6F978E37Elmoglickcom@24.94.165.86> <eV6V9.3880$ow3.33716366@news-text.cableinet.net> <Xns9306C5151212Elmoglickcom@24.94.165.86> <rgOV9.6728$kV.54312027@news-text.cableinet.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal12.airnews.net!usenet
Newsgroups: news.software.readers
Organization: Airnews.net! at Internet America
Lines: 92
X-Orig-Message-ID: <pan.2003.01.17.23.15.16.323325@talios.com>
Abuse-Reports-To: abuse at airmail.net to report improper postings
NNTP-Proxy-Relay: library2.airnews.net
NNTP-Posting-Time: Fri Jan 17 17:20:52 2003
NNTP-Posting-Host: !b5mh1k-Y,Ej./^EFNr&ApSFR (Encoded at Airnews!)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Pan/0.13.3 (That cat's something I can't explain)