<div><br><br> </div>
<div><span class="gmail_quote">2008/7/24, Ulf Wiger <<a href="mailto:ulf@wiger.net">ulf@wiger.net</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">If you are to gain any performance compared to a wrapper, or using<br>only table locks, you must do brain surgery on mnesia_locker. I<br>
strongly advise against that. The relationship between record locks<br>and table locks is quite intricate.</blockquote>
<div> </div>
<div>Yes.I want to gain some performance to lock part of the table.</div>
<div>What's the intricate part of the locking system design?Can you give any docs about the design of the mensia table-lock and record lock?</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">BR,<br>Ulf W<br><br>2008/7/24, devdoer bird <<a href="mailto:devdoer2@gmail.com">devdoer2@gmail.com</a>>:<br>
> The example I give is not good.,but I just need hack the mnesia lock :(.<br>><br>> I want to lock part of the table and which part is controled by the record's<br>> key's value range .Currently mnesia only support record lock and table<br>
> lock.<br>><br>><br>> 2008/7/24, Ulf Wiger <<a href="mailto:ulf@wiger.net">ulf@wiger.net</a>>:<br>>><br>>> I don't think you should hack mnesia for that. A simple wrapper<br>>> function will do nicely.<br>
>><br>>> BR,<br>>> Ulf W<br>>><br>>> 2008/7/23, devdoer bird <<a href="mailto:devdoer2@gmail.com">devdoer2@gmail.com</a>>:<br>>> > HI:<br>>> ><br>>> > I want to extend mnesia 's lock to add this function<br>
>> > "mnesia:lock(LockItem,LockType,ConditionFun)" .<br>>> ><br>>> > This function works in this way: If a table 's record passes the<br>>> > ConditionFun test,the the record is locked.<br>
>> ><br>>> > Eg.<br>>> > I have a user table with the record: -record(user,{name,age}).<br>>> ><br>>> > I want to lock the user's whose name begines with 'a' ,I can code<br>
>> > using<br>>> my<br>>> > customized " mnesia:lock(LockItem,LockType,ConditionFun)"<br>>> ><br>>> > like this:<br>>> ><br>>> > ConditionFun=fun(U)-><br>
>> > if<br>>> > U#<a href="http://user.name">user.name</a>=='a' -> true;<br>>> > true->false<br>>> > end<br>>> > end<br>>> > mnesia:lock(user,write,ConditionFun).<br>
>> ><br>>> > that is I want to lock part of the table.<br>>> ><br>>> > Have anyone done this before? How shall I extend the mensia lock? Any<br>>> > information will be helpful, I 'm quite unfamiliar with mnesia lock<br>
>> > system.<br>>> ><br>>><br>><br></blockquote></div><br>