Thread: [orbitcpp-list] perform_work, pending_work, can't work when blocking
Status: Beta
Brought to you by:
philipd
From: <la...@se...> - 2000-12-21 02:19:09
|
Perhaps I'm writing software all wrong, but I'm surprised how many challenges I'm running into using orbit for a simple but real server. I'm doubly surprised because I see so many postings of people working on the software. Perhaps the problems I'm having are really odd. I'd like the server to do something useful in addition to handling client requests (re-registering itself with a list of servers in a timely manner, like every few minutes). I can imagine many scenarios where it is not acceptable to have orb->run() essentially lockup your server now and forevermore! I see someone has at least thought about this by the tantilizing but unimplemented pending_work and perform_work methods in orbitcpp_orb.hh. Does anyone else have the need for this? Is anyone working on it? I've hacked a version that sets an alarm in src/IIOP/connection.c before select is called, then perform my work in the signal handler. This is inferior to a real implementation. If anyone is working on a real implementation, please let me know so I can help and use it. If no one is working on this, also let me know and perhaps I will then write the real implementation. Also, in a previous email, I pointed out the problem in orbit where a client will hang indefintely when the server crashes. Can it be no one else has a problem with this behavior?! I fixed this by hacking orbit's src/orbit-idl-compiler/backends/corbit-idl-c-stubs.c where it generated "write" code that did not error check because the environment variable BACKWARDS_COMPAT_0_4 was defined. -Lance. -- -=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=- Lance Welsh la...@se... Seascape Communications (650) 327-6890 -=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=- |
From: Sam C. <sa...@to...> - 2000-12-21 03:29:00
|
la...@se... <la...@se...> wrote: >=20 > I see someone has at least thought about this by the tantilizing but > unimplemented pending_work and perform_work methods in > orbitcpp_orb.hh. >=20 > Does anyone else have the need for this? Is anyone working on it? > I've hacked a version that sets an alarm in src/IIOP/connection.c > before select is called, then perform my work in the signal handler. > This is inferior to a real implementation. If anyone is working on a > real implementation, please let me know so I can help and use it. If > no one is working on this, also let me know and perhaps I will then > write the real implementation. I have need for this, to implement a sort of timeout on various objects, for protection from clients that misbehave. Luckily I don't need it right now, but I will soon. If all you're trying to do is avoid blocking (synchronous) operations, then you can use DII or a multithreaded ORB for the server. If you want a timeout event, then the best way is probably for the ORB to u= se the glib event loop instead of calling select() directly. There have been murmurs about the next version of ORBit using the glib event loop, which would make it possible to register your own timeout events. I don't know if that's still part of the plan. Multithreading support was also mentioned a few times, but again, I don't know if that's still part of the plan either. Would any ORBit developers (Elliot?) like to comment? You can find a multithreaded ORB (ORBit-mt) at: http://goethe.ira.uka.de/~wilhelmi/corba/orbit-mt.html I'm fairly sure that ORBit-mt uses the glib event loop, meaning you should be able to register your own timeout events instead of using a signal handler. --=20 Sam Couter | Internet Engineer | http://www.topic.com.au/ sa...@to... | tSA Consulting | OpenPGP key available on key servers OpenPGP fingerprint: A46B 9BB5 3148 7BEA 1F05 5BD5 8530 03AE DE89 C75C |
From: Brian M. <ba...@sn...> - 2000-12-21 08:09:07
|
>>>>> "Sam" == Sam Couter <sa...@to...> writes: Sam> If you want a timeout event, then the best way is probably Sam> for the ORB to use the glib event loop instead of calling Sam> select() directly. Sam> There have been murmurs about the next version of ORBit using Sam> the glib event loop, which would make it possible to register Sam> your own timeout events. I don't know if that's still part of Sam> the plan. Multithreading support was also mentioned a few Sam> times, but again, I don't know if that's still part of the Sam> plan either. Would any ORBit developers (Elliot?) like to Sam> comment? From <URL:http://icps.u-strasbg.fr/~genaud/ORBIT/x421.htm> "Unfortunately, I don't really see how to do timeouts with the normal CORBA event model, so I'm going to have to use the ORBit-specific hack of having a glib event loop which supports both CORBA events and timeouts. Another way, I am told, is something called an Evictor pattern. I should understand this soon once I get my fancy CORBA book in the mail. The final way is just to leak memory like a sieve leaks goldfish; this is the easiest thing to do." 1. What is the glib even loop? Is it or isn't it supported by ORBit? 2. What is the evictor pattern? Of course, this document seems to be really old now (looks the same last time I looked at it, 1 year+ ago), so not sure if it still applies. -- Brian May <ba...@sn...> |
From: Michael R. <mi...@ru...> - 2000-12-21 08:21:56
|
----- Original Message ----- From: "Brian May" <ba...@sn...> To: <orb...@li...> Sent: Donnerstag, 21. Dezember 2000 09:08 Subject: Re: [orbitcpp-list] Re: perform_work, pending_work, can't work when blocking > >>>>> "Sam" == Sam Couter <sa...@to...> writes: > > Sam> If you want a timeout event, then the best way is probably > Sam> for the ORB to use the glib event loop instead of calling > Sam> select() directly. > > Sam> There have been murmurs about the next version of ORBit using > Sam> the glib event loop, which would make it possible to register > Sam> your own timeout events. I don't know if that's still part of > Sam> the plan. Multithreading support was also mentioned a few > Sam> times, but again, I don't know if that's still part of the > Sam> plan either. Would any ORBit developers (Elliot?) like to > Sam> comment? > > From <URL:http://icps.u-strasbg.fr/~genaud/ORBIT/x421.htm> > > "Unfortunately, I don't really see how to do timeouts with the normal > CORBA event model, so I'm going to have to use the ORBit-specific hack > of having a glib event loop which supports both CORBA events and > timeouts. Another way, I am told, is something called an Evictor > pattern. I should understand this soon once I get my fancy CORBA book > in the mail. The final way is just to leak memory like a sieve leaks > goldfish; this is the easiest thing to do." > > 1. What is the glib even loop? Is it or isn't it supported by ORBit? > 2. What is the evictor pattern? For the evictor question have a look at http://industry.ebi.ac.uk/~lcwang/corba-wks/evictor/sld001.htm or for a more detailed explanation read the LifeCycle Mgmt chapter in "Advanced CORBA Programming with C++" (Michi Henning and Steve Vinoski) Michael |
From: <MHL...@t-...> - 2000-12-30 12:41:29
|
On Don, 21 Dez 2000 09:08:59 Brian May wrote: > [...] > > 1. What is the glib even loop? Is it or isn't it supported by ORBit? "glib event loop" refers to a set of functions defined by the library glib which can be invoced on a datastructure called GMainLoop. This datastructure e.g. holds timeouts or file descriptors to poll. If you want to use the glib event loop you - allocate the data structure - register timeouts and file descriptors - call g_main_run or repeatadly call g_main_iteration. (See glib/gmain.h) ORBit currenctly doesn't register its file descriptors for the glib event loop but uses its own algorithms. ORBit-mt _does_ use the event loop so it is no problem to register your own timeouts etc. which then coexist with ORBit's file descriptors. If you look in CVS for the ORBit2 sources you can see that once finished, ORBit2 will most likely use the glib event loop. _______________________________________________________________________ + --Martin. `*' /.\ /°.°\ _ /'°'\ (_) /'°'.°\ ,_. ,_, Merry X-Mas ~~[_]~~ (_) |ü| |