[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming.threads

Sequential consistency of my scalable distributed sequential lock

Ramine

12/5/2014 12:57:00 AM


Hello,


About the sequential consystency of my scalable distributed sequential
lock, my algorithm works on x86 architecture and i think my algorithm is
correct cause look at the source code of the WLock() method, since i am
using a Ticket spinlock with a proportional backoff on the writer side,
the Ticket spinlock is using a "lock add" assembler instruction to
increment a counter in the Enter() method of the ticket spinlock , and
this "lock add" assembler instruction is a barrier for stores and loads
on x86, so the WLock() method is sequential consistent and correct, now
look at the WUnlock() , we don't need an "sfence" cause stores are not
reordered with stores on x86 , so WUnlock() method is sequential
consistent and correct, now look at the RLock() method, since i am using
a "lock add" assembler instruction inside the call to the RLock() of the
distributed reader-writer lock , so it acts as a barrier and loads and
stores inside the reader section are not reordered with this barrier on
x86, so RLock() is sequential consistent and correct, and for RUnlock()
since i am calling RUnlock() of the distributed reader-writer mutex ,
this RUnlock() is calling "lock add" in assembler, so it acts as a
barrier so the the loads and stores that we are using after this barrier
are not reordrered with this barrier, so all in all my algorithm is
sequential consistent and correct on x86. So be confident cause i have
reasoned correctly and i think my algorithm is correct and it is a
powerful synchronization mechanism that can replace RCU and that can
replace Seqlock cause it beats Seqlock.

Disclaimer:

My software is provided on an "as-is" basis, with no warranties,
express or implied. The entire risk and liability of using it is yours.
Any damages resulting from the use or misuse of this software will be
the responsibility of the user.


You can download my scalable distributed sequential lock version 1.01 from:

https://sites.google.com/site/aminer68/scalable-distributed-seque...





Thank you,
Amine Moulay Ramdane.







5 Answers

Bruce

11/6/2007 9:54:00 PM

0

Thanks for the response.

The site is hosted on a shared hosting (discount asp .net), where I don't
hav control over testing and looking at the RAM etc. If every product is 3
KB of information, is that 4000*3 ?

How would I test if caching is faster than connecting to a database? (I want
to test speed of page load, and scalability).

I've stumbled upon http://www.webgecko.com/products..., is anyone
familiar with that? The page claims that it's much faster than storing in
application data, but I can't use it on a shared hosting :( Is there
something else similar?


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OftlhwiHIHA.3400@TK2MSFTNGP03.phx.gbl...

> It depends on the server hardware (amount of RAM) and the number of
> applications running on the server. This is the type of question that can
> only be answered by testing. For example, we have on idea how much memory
> is consumed by storing one of these productls, let alone 4000. If
> scalability is a concern, you should be striving to avoid page faults.
>
> The other concern is concurrency: I assume you have already realized the
> need to lock the application object while making changes to its contents.
> While the application is locked, no requests in the application can be
> served. Whether this is a concern or not depends on the frequency of price
> changes and can only be answered by testing.
>
> Is the call to the database so time-consuming that caching the data in
> application is necessary?


Anthony Jones

11/6/2007 10:09:00 PM

0

"Bruce" <fake_dont_send@anything_.com> wrote in message
news:e%23AQu$LIIHA.4592@TK2MSFTNGP02.phx.gbl...
> Thanks for the response.
>
> The site is hosted on a shared hosting (discount asp .net), where I don't
> hav control over testing and looking at the RAM etc. If every product is 3
> KB of information, is that 4000*3 ?
>
> How would I test if caching is faster than connecting to a database? (I
want
> to test speed of page load, and scalability).
>
> I've stumbled upon http://www.webgecko.com/products..., is anyone
> familiar with that? The page claims that it's much faster than storing in
> application data, but I can't use it on a shared hosting :( Is there
> something else similar?


Yeah use ASP.NET and do things like Response caching.

12MB of product data is peanuts.

If your concerned about performance then its more important to consider what
the hit rate will be and how much CPU your ASP code is going to consume.

--
Anthony Jones - MVP ASP/ASP.NET


Mike Brind

11/7/2007 3:25:00 PM

0

Another option is to use the FileSystem.Scripting object to generate a
static html version of each page, and show that. On each request. code can
check for the presence of an html file, and if it exists, show it (include
file, perhaps?), otherwise generate it from the database and show it. If
you amend the details of any product, code will delete the associated html
file.

--
Mike Brind

"Bruce" <fake_dont_send@anything_.com> wrote in message
news:e%23AQu$LIIHA.4592@TK2MSFTNGP02.phx.gbl...
> Thanks for the response.
>
> The site is hosted on a shared hosting (discount asp .net), where I don't
> hav control over testing and looking at the RAM etc. If every product is 3
> KB of information, is that 4000*3 ?
>
> How would I test if caching is faster than connecting to a database? (I
> want to test speed of page load, and scalability).
>
> I've stumbled upon http://www.webgecko.com/products..., is anyone
> familiar with that? The page claims that it's much faster than storing in
> application data, but I can't use it on a shared hosting :( Is there
> something else similar?
>
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:OftlhwiHIHA.3400@TK2MSFTNGP03.phx.gbl...
>
>> It depends on the server hardware (amount of RAM) and the number of
>> applications running on the server. This is the type of question that can
>> only be answered by testing. For example, we have on idea how much memory
>> is consumed by storing one of these productls, let alone 4000. If
>> scalability is a concern, you should be striving to avoid page faults.
>>
>> The other concern is concurrency: I assume you have already realized the
>> need to lock the application object while making changes to its contents.
>> While the application is locked, no requests in the application can be
>> served. Whether this is a concern or not depends on the frequency of
>> price changes and can only be answered by testing.
>>
>> Is the call to the database so time-consuming that caching the data in
>> application is necessary?
>
>


Mike Brind

11/7/2007 3:33:00 PM

0

Maybe not include files. You can't set their value dynamically. But
Server.Transfer would work.


"Mike Brind" <dummy@newsgroups.com> wrote in message
news:O4yKVJVIIHA.1316@TK2MSFTNGP02.phx.gbl...
> Another option is to use the FileSystem.Scripting object to generate a
> static html version of each page, and show that. On each request. code
> can check for the presence of an html file, and if it exists, show it
> (include file, perhaps?), otherwise generate it from the database and show
> it. If you amend the details of any product, code will delete the
> associated html file.
>
> --
> Mike Brind
>
> "Bruce" <fake_dont_send@anything_.com> wrote in message
> news:e%23AQu$LIIHA.4592@TK2MSFTNGP02.phx.gbl...
>> Thanks for the response.
>>
>> The site is hosted on a shared hosting (discount asp .net), where I don't
>> hav control over testing and looking at the RAM etc. If every product is
>> 3 KB of information, is that 4000*3 ?
>>
>> How would I test if caching is faster than connecting to a database? (I
>> want to test speed of page load, and scalability).
>>
>> I've stumbled upon http://www.webgecko.com/products..., is anyone
>> familiar with that? The page claims that it's much faster than storing in
>> application data, but I can't use it on a shared hosting :( Is there
>> something else similar?
>>
>>
>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>> news:OftlhwiHIHA.3400@TK2MSFTNGP03.phx.gbl...
>>
>>> It depends on the server hardware (amount of RAM) and the number of
>>> applications running on the server. This is the type of question that
>>> can only be answered by testing. For example, we have on idea how much
>>> memory is consumed by storing one of these productls, let alone 4000. If
>>> scalability is a concern, you should be striving to avoid page faults.
>>>
>>> The other concern is concurrency: I assume you have already realized the
>>> need to lock the application object while making changes to its
>>> contents. While the application is locked, no requests in the
>>> application can be served. Whether this is a concern or not depends on
>>> the frequency of price changes and can only be answered by testing.
>>>
>>> Is the call to the database so time-consuming that caching the data in
>>> application is necessary?
>>
>>
>
>


Mike Brind

11/7/2007 3:38:00 PM

0

Me and my spineroosms. Of course that should have been
Scripting.FileSystemObject.


"Mike Brind" <dummy@newsgroups.com> wrote in message
news:uuvbEOVIIHA.1324@TK2MSFTNGP06.phx.gbl...
> Maybe not include files. You can't set their value dynamically. But
> Server.Transfer would work.
>
>
> "Mike Brind" <dummy@newsgroups.com> wrote in message
> news:O4yKVJVIIHA.1316@TK2MSFTNGP02.phx.gbl...
>> Another option is to use the FileSystem.Scripting object to generate a
>> static html version of each page, and show that. On each request. code
>> can check for the presence of an html file, and if it exists, show it
>> (include file, perhaps?), otherwise generate it from the database and
>> show it. If you amend the details of any product, code will delete the
>> associated html file.
>>
>> --
>> Mike Brind
>>
>> "Bruce" <fake_dont_send@anything_.com> wrote in message
>> news:e%23AQu$LIIHA.4592@TK2MSFTNGP02.phx.gbl...
>>> Thanks for the response.
>>>
>>> The site is hosted on a shared hosting (discount asp .net), where I
>>> don't hav control over testing and looking at the RAM etc. If every
>>> product is 3 KB of information, is that 4000*3 ?
>>>
>>> How would I test if caching is faster than connecting to a database? (I
>>> want to test speed of page load, and scalability).
>>>
>>> I've stumbled upon http://www.webgecko.com/products..., is anyone
>>> familiar with that? The page claims that it's much faster than storing
>>> in application data, but I can't use it on a shared hosting :( Is there
>>> something else similar?
>>>
>>>
>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>> news:OftlhwiHIHA.3400@TK2MSFTNGP03.phx.gbl...
>>>
>>>> It depends on the server hardware (amount of RAM) and the number of
>>>> applications running on the server. This is the type of question that
>>>> can only be answered by testing. For example, we have on idea how much
>>>> memory is consumed by storing one of these productls, let alone 4000.
>>>> If scalability is a concern, you should be striving to avoid page
>>>> faults.
>>>>
>>>> The other concern is concurrency: I assume you have already realized
>>>> the need to lock the application object while making changes to its
>>>> contents. While the application is locked, no requests in the
>>>> application can be served. Whether this is a concern or not depends on
>>>> the frequency of price changes and can only be answered by testing.
>>>>
>>>> Is the call to the database so time-consuming that caching the data in
>>>> application is necessary?
>>>
>>>
>>
>>
>
>