Using glib without calling g_main_loop_run?

Is it right to use (parts of) GLib without calling g_main_loop_run? If so, how can I identify which parts of GLib I can use this way?

I am most interested in (as mentioned by https://developer.gnome.org/glib/2.34/index.html ):

  • GLib data types;
  • GLib utilities.

Common sense tells me that there should not be anything GMainLoop would require (except for Timers, maybe?), But I'm a complete newbie to GLib and for some reason did not find an explicit expression in the documents when GMainLoop is required and when not.

In the section “Basic GLib Application Support”, I would like to use Message Logging, but I'm not sure about this interaction with the main loop.

For those who wonder why, I use FUSE / osxfuse, which already has its own main loop, and I'm not sure how easy it is to deconstruct it and integrate into GMainLoop.

In addition, I welcome the alternative suggestions of the C library. Looking at the GLib docs, I like it, but I feel awkward trying to be a framework, not a collection of libraries.

+4
source share
1 answer

Very little GLib code requires a main loop, for example, timers are implemented using a standard system timestamp.

Code that requires a main loop will reference it, such as IO Channels . Even then you can see that it is possible to use I / O channels with or without a main circuit, this is your choice.

+2
source

Source: https://habr.com/ru/post/1488605/


All Articles