This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how many slaves are created at one time?

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS
Hi all,
I'm developing a kioslave, and I was thinking that a single instance of a slave is created each time a user enters an URL that responds /i.e., is registered for) such slave. In my case I've got that the protocol file contains:

Code: Select all
[Protocol]
exec=kio_rolefs
protocol=rolefs


and the kdemain entry method for the slave has the following:

Code: Select all
extern "C" int KDE_EXPORT kdemain( int argc, char **argv )
{
  kDebug(RoleFSDebugArea()) << "[kdemain] starting";
  KComponentData instance( "kio_rolefs" );

   
 
  kDebug(RoleFSDebugArea()) << "kdemain is creating a slave...";
  RoleFSKIOSlave slave( "Hello","Slave", instance, argv[2], argv[3] );
  kDebug(RoleFSDebugArea()) << "staring the dispatch loop";
  slave.dispatchLoop();
  kDebug(RoleFSDebugArea()) << "kdemain] ending";
  return 0;
}


The problem, or better, my doubt, is that if I launch the url rolefs:/// from the klauncher (ALT+F2) and I look at the ~/.xsession-errors I can see the following entries:

Code: Select all
unnamed app(9078)/[RoleFS debug] kdemain: [kdemain] starting
kio_rolefs(9078)/[RoleFS debug] kdemain: kdemain is creating a slave...
kio_rolefs(9078)/[RoleFS debug] kdemain: staring the dispatch loop
unnamed app(9084)/[RoleFS debug] kdemain: [kdemain] starting
kio_rolefs(9084)/[RoleFS debug] kdemain: kdemain is creating a slave...
kio_rolefs(9084)/[RoleFS debug] kdemain: staring the dispatch loop
unnamed app(9087)/[RoleFS debug] kdemain: [kdemain] starting
kio_rolefs(9087)/[RoleFS debug] kdemain: kdemain is creating a slave...
unnamed app(9088)/[RoleFS debug] kdemain: [kdemain] starting
kio_rolefs(9088)/[RoleFS debug] kdemain: kdemain is creating a slave...
kio_rolefs(9087)/[RoleFS debug] kdemain: staring the dispatch loop
unnamed app(9089)/[RoleFS debug] kdemain: [kdemain] starting
kio_rolefs(9089)/[RoleFS debug] kdemain: kdemain is creating a slave...
kio_rolefs(9089)/[RoleFS debug] kdemain: staring the dispatch loop
kio_rolefs(9088)/[RoleFS debug] kdemain: staring the dispatch loop
unnamed app(9090)/[RoleFS debug] kdemain: [kdemain] starting
kio_rolefs(9090)/[RoleFS debug] kdemain: kdemain is creating a slave...
kio_rolefs(9090)/[RoleFS debug] kdemain: staring the dispatch loop



so it seems that there are six calls to the kdemain method, and therefore six slaves running. This can produce problems with re-entrancy, and that is why I'd like to better understand what is happening and who is actually doing the six kdemain entry calls.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Each KIO Slave instance is started as a seperate process, which protects against re-entrancy.
Slaves are launched by KLauncher as needed.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
fluca1978
Registered Member
Posts
81
Karma
0
OS
And is it possible to make intra-slave communication? For instance, if the user launches two slaves on the same URL and then works only on one of them, how can the other get updates too?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
As far as I am aware the exact mechanics of how it operates are handled by KIO itself. It will ensure it doesn't make too many repetitive requests, etc. If you need further information on this, I would recommend contacting kde-devel@kde.org where people more knowledgable about KIO can answer information specific to it's internals.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft