Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » GTK+
  • » Q: Suitability of GTK+ for critical embedded application [RSS Feed]

#1 Dec. 3, 2005 16:40:49

Are L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Q: Suitability of GTK+ for critical embedded application


Hello GTK list!

I'm evaluating GTK+ as the GUI/windowing toolkit for an embedded project.
After spending a long time reviewing various toolkits, GTK+ is the one
candidate that has bubbled to the top. The other alternative is an
existing proprietary toolkit which is quite good, but the effort
reequired to maintain it could potentially be quite large.
Being able to draw on, and perhaps eventually contribute to, the GTK
communitys efforts is the main advantage for me in picking it up.
So far the concept and the API seems fine and the fact that it's all
in pure C is a big advantage.

The one thing that makes me hesitate is the question about stability.
By stability I mean lack of (serious) bugs and memory leaks.
I've tried to research this on the net, but there's not much to find
in the way of comments on, or assessements of, GTK+ stability.
Since GTK+ uses a number of 3rd party libraries these must
be factored in as well.

The application in question is mission critical, and must be able to
run for extended periods (weeks or more) without any kind of cumulative
degradation of the performance.

If GTK+ gets adopted it will preferably run without X, but rather
use a framebuffer, so or GTK+ on DirectFB is a possibility.
It is noted that GTKfb is no longer maintained. The target platform
is a x86 (ITX) with Suse Linux 2.6, but Windows is used for parts of
the development cycle and the application must be able to run there.
The application is demanding it that it will employ a high number
of widgets. Several thousands of GUI objects will be created, and
several hundred of these may be exposed at any one time.
Responsive interactivity and quick redrawing is important.

To get a better handle on the suitability of GTK in this case, I ask
the list members for subjective and objective comments on a few issues:

- general stability of GTK+ (bugs/leaks)?
- suitability of GTK+ for mission critical embedded application?
- any hints and tips for this kind of GTK+ usage?
- best GTK+ options for use with linux framebuffer?
- performance with thousands visible/hidden widgets on a 500MHz system?
- to use glade or not... potential problems/instabilities?
- is there a minimal HTML rendering widget available (for a help system)?

Any comments or pointers to information will be greatly appreciated.

AL
--
_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#2 Dec. 3, 2005 22:01:50

i.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Q: Suitability of GTK+ for critical embedded application


Hello Are,

On Sat, Dec 03, 2005 at 05:38:17PM +0100, Are Leistad wrote:
> - suitability of GTK+ for mission critical embedded application?

You might be interested to investigate the behavior in the case of
virtual memory exhaustion. As I looked at glib, I couldn't see an
elegant way to pass that fact to the caller. E.g., g_list_append returns
the new list head; if there is no memory available, the application is
supposed to exit (please correct me if I'm wrong), which is not quite
nice for an embedded app. A possible workaround could be calling some
handler in your code, but I haven't looked at that. If you are
interested, we could try to do that together.

With kind regards,
Baurzhan.
_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#3 Dec. 4, 2005 04:08:12

Michael T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Q: Suitability of GTK+ for critical embedded application


On Sat, 2005-12-03 at 17:38 +0100, Are Leistad wrote:
> If GTK+ gets adopted it will preferably run without X, but rather
> use a framebuffer, so or GTK+ on DirectFB is a possibility.
> It is noted that GTKfb is no longer maintained. The target platform
> is a x86 (ITX) with Suse Linux 2.6, but Windows is used for parts of
> the development cycle and the application must be able to run there.
> The application is demanding it that it will employ a high number
> of widgets. Several thousands of GUI objects will be created, and
> several hundred of these may be exposed at any one time.
> Responsive interactivity and quick redrawing is important.

Actually I think you'll find that running GTK on an embedded X-server
works very well. In fact I think it's a much better idea than the
framebuffer, since GTKfb really has to implement GTK plus the stuff X
provides. If you check out the kdrive X server from
www.freedesktop.org, I think you'll find it can be less than a mb in
binary size and run fine on just a few mb of RAM. Not much larger with
GTK/X than GTKfb. A tiny window manager, matchbox also works well for
an embedded system with a small screen.

When you say you are considering GTK for an embedded situation, I take
it you're not meaning real-time or microcontroller, but a small, full-
blown computer running a full protected-mode, virtual memory OS. If
not, GTK simply can't work. GTK must have dynamic memory allocation
available from the OS.

I'm found based on my experience with GTK and with many GTK apps that
the stable GTK libraries have no known memory leaks. In fact the
underlying glib libraries are so well-written that I can in one of my
app (over the course of months) build and destroy millions of dynamic
tree stuctures containing glib objects (lists, strings, etc) and not one
leak. It has been a while since a real memory leak has been discovered
in the gui stuff in GTK. In fact most of the supposed leaks reported in
recent months were really just the programmer not quite understanding
how the reference counting and object destruction worked.

Michael



--
Michael Torrie <>

_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#4 Dec. 4, 2005 18:32:14

John C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Q: Suitability of GTK+ for critical embedded application


On 12/3/05, Are Leistad <> wrote:
> The one thing that makes me hesitate is the question about stability.
> By stability I mean lack of (serious) bugs and memory leaks.

I'm not embedded, but the GTK app I usually work on (medium sized?
250,000 lines) seems leak-free, according to valgrind.

I've found three or four GTK crash bugs over the last five years, but
they've been easy to patch around. Having the source to the whole GUI
is just great. I've posted fixes to bugzilla and they've gone into GTK
(and in to the next version) within a few days, usually.

Something people have complained about is out of memory handling. GTK
does not even attempt to do this: if malloc() fails, your program will
promptly abort(). A possible fix is to keep some small-ish amount of
RAM in reserve (1MB?) and to start using that when the system malloc()
stops. That gives your program a little time to either save state and
restart, or perhaps flush some caches or something and keep going.

> - performance with thousands visible/hidden widgets on a 500MHz system?

GTK used to feel fast on my 450MHz desktop machine 5 years ago. It's
become a bit slower since then with the fancy new font system. It
should be easy to do some benchmarks I guess.

> - is there a minimal HTML rendering widget available (for a help system)?

Yes, there's gtkhtml2, though I've not used it. I think it just does
plain HTML (ie. no CSS etc).
_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#5 Dec. 5, 2005 00:17:08

Are L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Q: Suitability of GTK+ for critical embedded application


Baurzhan wrote:

> You might be interested to investigate the behavior in the case of
> virtual memory exhaustion. As I looked at glib, I couldn't see an
> elegant way to pass that fact to the caller. E.g., g_list_append returns
> the new list head; if there is no memory available, the application is
> supposed to exit (please correct me if I'm wrong), which is not quite
> nice for an embedded app. A possible workaround could be calling some
> handler in your code, but I haven't looked at that. If you are
> interested, we could try to do that together.

This is duly noted - can't have forced exits. This will have to be
handled indeed.

In this system there will be no VM. It will have a healthy amount of
RAM though, probably 256MB of which at least half is available to the
application. The memory usage is (must be!) controlled in that it is
guaranteed to never exceed a known maximum, and a margin will be
set off to allow for fragmentation. Of course getting to know what
the usage of GTK is may be a challenge.

This reminds me of another question: are there facilities in GTK for
monitoring or logging resource usage? Or are there some information
on actual usage available (per feature/subsystem/widget)?

Our proprietary GUI tracks all malloc/free calls as well as keeping
statistics for objects and events. This would be hard to live without.


Michael Torrie wrote:

> Actually I think you'll find that running GTK on an embedded X-server
> works very well.

It also looks like it's fastest with X. At least from this somewhat
old but still interesting report:http://www.bluemug.com/research/linux_performance/index.shtml> A When you say you are considering GTK for an embedded situation,
> I take it you're not meaning real-time or microcontroller

Thats right. It's a full x86 ISA on the ITX form factor. There's no
harddisks, only a FLASH IDE module.

> I'm found based on my experience with GTK and with many GTK apps
> that the stable GTK libraries have no known memory leaks.

This sounds good. From Baurzhan and Michaels answers it's clear
that I shall need to have a good look a glib though.


John Cupitt wrote:

> I'm not embedded, but the GTK app I usually work on (medium sized?
> 250,000 lines) seems leak-free, according to valgrind.

I'd say that's a fair sized application :) It's good to hear a report
indicating good general integrity.

> Something people have complained about is out of memory handling.

Right. That seems to be a springning point. I would have though it
obviously that graceful handling of memory exhaustion is a must have.

> GTK used to feel fast on my 450MHz desktop machine 5 years ago. It's
> become a bit slower since then with the fancy new font system. It
> should be easy to do some benchmarks I guess.

I need a GUI that feels fast on a 500MHZ system 5 years from now :)
You're right of course, benchmarking is easy. I'll make a mock up of
parts of the interface and see for myself.

> Yes, there's gtkhtml2

I'll look that up, although CSS is really needed. I have a nearly completed
one in the prorietary bin which will probably be used anyway.


Baurzhan, Michael, John - Thank you very much for your responses!
It's exacly the stuff I'm after.

This matter will take some time to decide upon (there are others who have
a say). I'll let you know which way it goes. In the mean time I'll watch
for more comments on this. In any case, I need a new toolkit for general
C and Ada programming and that is likely going to be GTK+.


AL
--





_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

  • Root
  • » GTK+
  • » Q: Suitability of GTK+ for critical embedded application [RSS Feed]

Board footer

Moderator control

Enjoy the 24th of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support