Re: [Monetdb-developers] [Monetdb-pf-checkins] pathfinder/runtime xrpc_common.mx, , 1.4, 1.5 xrpc_server.mx, , 1.77, 1.78
Jennie, in fact, only xprc_admin and xrpc_trusted are currently(?) used/required as global C variable in xrpc_server.c , all other BATs are indeed share as (global) MIL variables and/or via the BAT names. Hence, the attached patch would IMHO clean-up the code even more. (I.e., reduce use of / need for global variables as much as possible.) Stefan On Thu, Jul 17, 2008 at 10:51:38AM +0000, Ying Zhang wrote:
Update of /cvsroot/monetdb/pathfinder/runtime In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24940
Modified Files: xrpc_common.mx xrpc_server.mx Log Message: Try to fix bug
[ 2020269 ] PF/runtime fails to link on Darwin (MacOS X)
remove declaratin of BATs xrpc_* from xrpc_common.mx xrpc_trusted and xrpc_admin are not shared BATs (only used by xrpc_server), the others are shared via MIL, so should no be (re)defined in xrpc_common.mx
U xrpc_common.mx Index: xrpc_common.mx =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_common.mx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- xrpc_common.mx 15 Jul 2008 14:14:21 -0000 1.4 +++ xrpc_common.mx 17 Jul 2008 10:51:33 -0000 1.5 @@ -182,14 +182,6 @@ XRPCreq_t *xrpc_parse_message(char *err, int errlen, BAT *shredBAT, BAT *participants);
-BAT *xrpc_qids; -BAT *xrpc_timeouts; -BAT *xrpc_statuses; -BAT *xrpc_locks; -BAT *xrpc_wsbats; -BAT *xrpc_trusted; -BAT *xrpc_admin; - #endif /* XRPC_COMMON_H */
@c
U xrpc_server.mx Index: xrpc_server.mx =================================================================== RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc_server.mx,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- xrpc_server.mx 15 Jul 2008 14:14:23 -0000 1.77 +++ xrpc_server.mx 17 Jul 2008 10:51:33 -0000 1.78 @@ -194,6 +194,12 @@ static MT_Sema xrpc_commit_sema; static xrpc_commit_t *xrpc_commit_active = NULL;
+/* shared BATs */ +BAT *xrpc_qids = NULL, *xrpc_statuses = NULL, *xrpc_timeouts = NULL; +BAT *xrpc_locks = NULL, *xrpc_wsbats = NULL; +/* only used by xrpc_server */ +BAT *xrpc_trusted = NULL, *xrpc_admin = NULL, *xrpc_user = NULL; + int CMDmy_hostname(char **res) { int ret = 0, len = HOST_NAME_MAX > 255 ? HOST_NAME_MAX : 255; @@ -871,9 +877,6 @@ BATseqbase(xrpc_@1, 1); BBPrename(xrpc_@1->batCacheid, "xrpc_@1"); @c -BAT *xrpc_qids = NULL, *xrpc_statuses = NULL, *xrpc_timeouts = NULL, *xrpc_locks = NULL, *xrpc_wsbats = NULL; -BAT *xrpc_trusted = NULL, *xrpc_admin = NULL, *xrpc_user = NULL; -
bat* xrpc_prelude(void) { @:xrpc_bat(qids,str)@ @@ -881,6 +884,7 @@ @:xrpc_bat(timeouts,lng)@ @:xrpc_bat(locks,lock)@ @:xrpc_bat(wsbats,bat)@ + @:xrpc_bat(trusted,str)@ @:xrpc_bat(admin,str)@ @:xrpc_bat(user,str)@
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-pf-checkins mailing list Monetdb-pf-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
Hi Stefan, You are right (again). A small question:
@= xrpc_bat - xrpc_@1 = BATnew(TYPE_void,ATOMindex("@2"),1024); - assert(xrpc_@1); - BATseqbase(xrpc_@1, 1); - BBPrename(xrpc_@1->batCacheid, "xrpc_@1"); + xrpc_bat = BATnew(TYPE_void,ATOMindex("@2"),1024); + assert(xrpc_bat); + BATseqbase(xrpc_bat, 1); + BBPrename(xrpc_bat->batCacheid, "xrpc_@1"); @c
bat* xrpc_prelude(void) { + BAT *xrpc_bat = NULL; @:xrpc_bat(qids,str)@ @:xrpc_bat(statuses,str)@ @:xrpc_bat(timeouts,lng)@ @@ -886,7 +883,9 @@ @:xrpc_bat(wsbats,bat)@
@:xrpc_bat(trusted,str)@ + xrpc_trusted = xrpc_bat; @:xrpc_bat(admin,str)@ + xrpc_admin = xrpc_bat;
Is there a particular reason to change this macro? Jennie
On Thu, Jul 17, 2008 at 01:27:37PM +0200, Ying Zhang wrote:
Hi Stefan,
You are right (again). A small question:
@= xrpc_bat - xrpc_@1 = BATnew(TYPE_void,ATOMindex("@2"),1024); - assert(xrpc_@1); - BATseqbase(xrpc_@1, 1); - BBPrename(xrpc_@1->batCacheid, "xrpc_@1"); + xrpc_bat = BATnew(TYPE_void,ATOMindex("@2"),1024); + assert(xrpc_bat); + BATseqbase(xrpc_bat, 1); + BBPrename(xrpc_bat->batCacheid, "xrpc_@1"); @c
bat* xrpc_prelude(void) { + BAT *xrpc_bat = NULL; @:xrpc_bat(qids,str)@ @:xrpc_bat(statuses,str)@ @:xrpc_bat(timeouts,lng)@ @@ -886,7 +883,9 @@ @:xrpc_bat(wsbats,bat)@
@:xrpc_bat(trusted,str)@ + xrpc_trusted = xrpc_bat; @:xrpc_bat(admin,str)@ + xrpc_admin = xrpc_bat;
Is there a particular reason to change this macro?
yes: use 1 local variable instead of 8 global variables. Stefan
Jennie
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
On Thu, Jul 17, 2008 at 01:31:51PM +0200, Stefan Manegold wrote:
On Thu, Jul 17, 2008 at 01:27:37PM +0200, Ying Zhang wrote:
Hi Stefan,
You are right (again). A small question:
@= xrpc_bat - xrpc_@1 = BATnew(TYPE_void,ATOMindex("@2"),1024); - assert(xrpc_@1); - BATseqbase(xrpc_@1, 1); - BBPrename(xrpc_@1->batCacheid, "xrpc_@1"); + xrpc_bat = BATnew(TYPE_void,ATOMindex("@2"),1024); + assert(xrpc_bat); + BATseqbase(xrpc_bat, 1); + BBPrename(xrpc_bat->batCacheid, "xrpc_@1"); @c
bat* xrpc_prelude(void) { + BAT *xrpc_bat = NULL; @:xrpc_bat(qids,str)@ @:xrpc_bat(statuses,str)@ @:xrpc_bat(timeouts,lng)@ @@ -886,7 +883,9 @@ @:xrpc_bat(wsbats,bat)@
@:xrpc_bat(trusted,str)@ + xrpc_trusted = xrpc_bat; @:xrpc_bat(admin,str)@ + xrpc_admin = xrpc_bat;
Is there a particular reason to change this macro?
yes: use 1 local variable instead of 8 global variables.
There are only 2 global variables left, and they are created/initialized hier. I didn't see the need to introduce a new (local) var for this. Or do I miss something? Jennie
Stefan
Jennie
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
On Thu, Jul 17, 2008 at 01:47:20PM +0200, Ying Zhang wrote:
On Thu, Jul 17, 2008 at 01:31:51PM +0200, Stefan Manegold wrote:
On Thu, Jul 17, 2008 at 01:27:37PM +0200, Ying Zhang wrote:
Hi Stefan,
You are right (again). A small question:
@= xrpc_bat - xrpc_@1 = BATnew(TYPE_void,ATOMindex("@2"),1024); - assert(xrpc_@1); - BATseqbase(xrpc_@1, 1); - BBPrename(xrpc_@1->batCacheid, "xrpc_@1"); + xrpc_bat = BATnew(TYPE_void,ATOMindex("@2"),1024); + assert(xrpc_bat); + BATseqbase(xrpc_bat, 1); + BBPrename(xrpc_bat->batCacheid, "xrpc_@1"); @c
bat* xrpc_prelude(void) { + BAT *xrpc_bat = NULL; @:xrpc_bat(qids,str)@ @:xrpc_bat(statuses,str)@ @:xrpc_bat(timeouts,lng)@ @@ -886,7 +883,9 @@ @:xrpc_bat(wsbats,bat)@
@:xrpc_bat(trusted,str)@ + xrpc_trusted = xrpc_bat; @:xrpc_bat(admin,str)@ + xrpc_admin = xrpc_bat;
Is there a particular reason to change this macro?
yes: use 1 local variable instead of 8 global variables.
There are only 2 global variables left, and they are created/initialized hier. I didn't see the need to introduce a new (local) var for this. Or do I miss something?
Without the above modification the macro expects/used variables xrpc_@1, i.e., with two of them defined globally (xrpc_trusted & xrpc_admin) the remaining 6 (xrpc_{qids,statuses,timeouts,locks,wsbats,user} would need to be define locally in xrpc_prelude() --- not a problem as such, but instead of defining these 6 varibles or single-use, I decided to define only a single one (xrpc_bat) and re-use it ... Stefan
Jennie
Stefan
Jennie
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
participants (2)
-
Stefan Manegold
-
Ying Zhang