1999Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: [DevMUD] Re: From Devmud: Database module, draft 3 -->
<!--X-From-R13: Uert Qbaabe <tpbaabeNarxbqbwb.bet> -->
<!--X-Date: Wed, 20 Jan 1999 15:58:00 &#45;0800 -->
<!--X-Message-Id: 4.1.19990120155740.00b7b180#pop,nekodojo.org -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: [DevMUD] Re: From Devmud: Database module, draft</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:gconnor#nekodojo,org">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00234.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00222.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00222.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00228.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00221">Author</A>
&nbsp;|&nbsp;<A HREF="#00221">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00221">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: [DevMUD] Re: From Devmud: Database module, draft 3</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:devmud#kanga,nu">devmud#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: [DevMUD] Re: From Devmud: Database module, draft 3</LI>
<LI><em>From</em>: Greg Connor &lt;<A HREF="mailto:gconnor#nekodojo,org">gconnor#nekodojo,org</A>&gt;</LI>
<LI><em>Date</em>: Wed, 20 Jan 1999 15:57:47 -0800</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
&gt; &gt; = [Greg Connor:]
&gt; &gt;This was because db_direct_writeable_record gives you a writeable record,
&gt; &gt;but doesn't actually "write" to the database until you release it, so
&gt; &gt;"write" might be misleading.  The closest action word is probably "get" ..
&gt; &gt;I think I had that in there and took it out to shorten it a bit :)
&gt;
&gt; = Chris Gray wrote:
&gt;Hmm. OK. The consistency and clarity of the naming does suffer a bit,
&gt;however. Even though I dislike long names, I'm tempted to suggest
&gt;putting the 'get' and 'put' back.


You're probably right... why save a few characters at the expense of
clarity? :)


&gt; &gt;[when getting fields one at a time...]
&gt; &gt;A lock would be useful to the client, but I'm still going to try to weasel
&gt; &gt;out of implementing one.  What if you could mark several fields that you
&gt; &gt;want to fetch (like setting a flag in the db_record header) and sumbit one
&gt; &gt;call to get them all?  This might save some overhead too, for network
&gt; &gt;sources.
&gt;
&gt;That would work. Some solution is needed here, and I understand your
&gt;reluctance to require locking. Locks bring up the whole question of
&gt;how you make someone wait on a lock - sounds like you need a spec
&gt;for a core-provided threading package, at least a wait-for-lock entry
&gt;(which should always just return in a non-threaded server).


You're right, I hadn't thought about the locks that much.  Locks and
threading would probably add up to trouble.  I'll enable multiple things to
be fetched at once and keep "lock" out of the interface for now.


In the direct mode, where I have a lock/release defined, it's not designed
for threading, just to keep you from doing something silly, so returning
with an error would be appropriate.  If your server is single-threaded, not
much sense calling wait()...

I am probably going to move the direct mode calls to the "not now,
investigate for version 2" list.  I dread the thought of implementing locks
if they're only going to be used as an optimization (and a dubious one) and
limited to single-threads.  I will probably have a better feeling for
whether this is needed when the prototype method-2 only version can be tested.


&gt; &gt;Db_record (the structure) is what you said second: address/length pairs
&gt; &gt;(possibly some flags to go with each field, like whether it is loaded,
&gt; &gt;null, requesting to be read, requesting to be written, etc).. It is only
&gt; &gt;variable in size to the extent that you will add or remove fields.  
&gt;
&gt;Ah, ok. So, db_get_record_header_size says how big the db_record
&gt;structure for that record will be and db_get_record_header copies the
&gt;struct in. Given that, why does one need db_get_field_size? If the
&gt;user is to be able to examine/set flags per field, then the contents
&gt;of a db_record are public. It could be implemented as a macro, but a
&gt;call to it will be longer than just grabbing the length directly.


You're right.. I had "get_field_size" in there for symmetry but it isn't
really needed.  db_record should be a public structure type... it might
have some fields that only make sense to dbmodule itself (like revision
info or some other cookie to validate write-back changes) but I think that
won't bother things much.  So strike the "get_field_size".

Size info might be out of date if someone else modified the record between
one fetch and the next, but in this case you would get a "not big enough"
error and realloc/try again.  There should be a call to refresh the header
(maybe just calling get with no fields marked would do this).

Thanks for the feedback.  I'll revise the spec again this week or this
weekend with the changes to date.  I may even get to write some code this
weekend (er, if header files count :)




</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00234.html">[MUD-Dev] Re: Thoughts</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00222.html">[MUD-Dev] Re: ADMIN: List server and Kanga.Nu host changes</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00222.html">[MUD-Dev] Re: ADMIN: List server and Kanga.Nu host changes</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00228.html">[MUD-Dev] Re: Sockets and fibers</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00221"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00221"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: META: list "peerage"</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00300" HREF="msg00300.html">[MUD-Dev] Re: META: list "peerage"</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 27 Jan 1999, 02:00 GMT
</LI>
</ul>
</ul>
<LI><strong><A NAME="00293" HREF="msg00293.html">[MUD-Dev] Re: META: list "peerage"</A></strong>, 
Bruce Mitchener, Jr. <a href="mailto:bruce#puremagic,com">bruce#puremagic,com</a>, Tue 26 Jan 1999, 21:06 GMT
</LI>
<LI><strong><A NAME="00453" HREF="msg00453.html">[MUD-Dev] Re: META: list "peerage"</A></strong>, 
Sayeed <a href="mailto:yu219121#YorkU,CA">yu219121#YorkU,CA</a>, Thu 18 Feb 1999, 18:07 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00222" HREF="msg00222.html">[MUD-Dev] Re: ADMIN: List server and Kanga.Nu host changes</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Thu 21 Jan 1999, 00:04 GMT
<LI><strong><A NAME="00221" HREF="msg00221.html">[MUD-Dev] Re: [DevMUD] Re: From Devmud: Database module, draft 3</A></strong>, 
Greg Connor <a href="mailto:gconnor#nekodojo,org">gconnor#nekodojo,org</a>, Wed 20 Jan 1999, 23:58 GMT
<LI><strong><A NAME="00228" HREF="msg00228.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 20 Jan 1999, 18:41 GMT
<UL>
<LI><strong><A NAME="00239" HREF="msg00239.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Thu 21 Jan 1999, 02:27 GMT
</LI>
<LI><strong><A NAME="00241" HREF="msg00241.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 21 Jan 1999, 04:01 GMT
<UL>
<LI><strong><A NAME="00243" HREF="msg00243.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 25 Jan 1999, 02:00 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>