monikers, multi-threading



Hi!

I need your input...

GnoCam comes with a gnome-vfs-module for digital cameras. This module
will get loaded by nautilus (perhaps even by multiple different nautilus
applications) and other applications. However, a digital camera can only
handle one request after another. Hence, I need to serialize the
"multithreaded, multi-application" gnome-vfs requests system-wide. 

I cannot use a global mutex in the module as the module will get loaded
by different apps. 

I thought redirecting all request to a moniker could be the solution.
One moniker, several apps. Indeed, this works if I serialize the
requests in the module using a global mutex. If I just pass all requests
to the moniker, something hangs.

Console output of nautilus:

camera-method.c:631 vfs_module_init() ENTER
camera-method.c:645 vfs_module_init() EXIT
camera-method.c:312 do_open_directory() ENTER
camera-method.c:319 do_open_directory() Getting storage for
camera://directory...
camera-method.c:495 do_get_file_info() ENTER
camera-method.c:509 do_get_file_info() Trying to get storage for
camera://directory...
camera-method.c:495 do_get_file_info() ENTER
camera-method.c:509 do_get_file_info() Trying to get storage for
camera://directory...

What you see is that three threads are executed. Every thread/function
requests a storage from the moniker (I am using "bonobo_get_object
(moniker, "IDL:Bonobo/Storage:1.0", &ev);" in the gnome-vfs-module)

The moniker itself has the following output:

lutz abh-410:~$ bonobo-moniker-camera 
GnoCam-Message: Trying to resolve //directory...
GnoCam-Message: ... as storage.
gphoto-extensions.c:0073 gp_camera_new_from_gconf() ENTER
gphoto-extensions.c:0074 gp_camera_new_from_gconf() name_or_url:
//directory
gphoto-extensions.c:0088 gp_camera_new_from_gconf()   Initializing
gconf...
gphoto-extensions.c:0094 gp_camera_new_from_gconf()   Getting default
client...
gphoto-extensions.c:0113 gp_camera_new_from_gconf()   Getting list of
configured cameras...
gphoto-extensions.c:0146 gp_camera_new_from_gconf() Looking for model
'Directory Browse' on port ''...
gphoto-extensions.c:0161 gp_camera_new_from_gconf() Creating new
camera...
gphoto-extensions.c:0172 gp_camera_new_from_gconf() Initializing
camera...
gphoto-extensions.c:0198 gp_camera_new_from_gconf() EXIT
GnoCam-Message: Returning storage...

What you see here is that a storage is returned (in this case for "/"),
but that's it. Normally, I would assume that the moniker will
immediately process the next request (yet another storage), but -
nothing else happens. 

If I do "moniker-test -r camera://directory/home/lutz/Beispiel.png", the
moniker responds perfectly. 

But nautilus/the gnome-vfs-module won't even report that the storage has
been received. It is lost somewhere between the gnome-vfs-module and the
moniker. But where???

As I said, introducing a global mutex in the module, thus serializing
the requests for storages, helps.

I don't understand...

Thank you!

Lutz Müller
-- 
                                                        \|||/
+------------------------------------------------+      (o o)
| Lutz Mueller           +49 (7156) 34837        +---ooO-(_)-Ooo---+
|                                                                  |
| Hans-Sachs-Strasse 5                                             |
| 71254 Ditzingen        http://www.uni-karlsruhe.de/~Lutz.Mueller |
| Germany                urc8 rz uni-karlsruhe de                  |
+------------------------------------------------------------------+





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]