Web Forms :: How To Synchronize Users Requests / Threads

Feb 6, 2011

I have what I consider a pretty complex situation that I am not sure if it can even be accomplished via an ASP.NET web application. (I am using aps.net 4.0) But what I want to do is design a "online auction site" that can handle many autions running at the same time. So I can only imagine eBay and all the other millions of auction sites out there are all doing this someway or another. My biggest concern is that I want to make sure the design here to make the site as effiecent as possible. Here is specifically what I am trying to figure out.

I think I need to create an object (per active auction) that stays in memory for the life of the auction. This object would have at least the following information:

Aution ID, time remaining, highest bidder id, bid price, Thread Control Variable, etc...

Now here is the tricky part that I think is vital for auction sites. Lets say you have 500 users on my website that are all watching the same auction and it is getting down to the last second of the auction and they all click to place a bid at the same time. Keep in mind this may also be at the same time hundreds of other users are placing bids for other auctions going on all at the same time.

How do I get all these requests (bids), for a single auction, lined up so that they are processed "one at a time"? But some how I need to be able to make all requests wait in a queue until it is their "turn" then I would need to be able to update the in memory object, write a record into a SQL database and then begin returning information back to each user.

Based on other development languages I have used in the past I know their were objects that I could create that could be used to get multiple threads to run in order (in other words syncronized). Usually it would be a case where I would be listening on a server socket and could do something like ThreadVariable.Lock, <process the request>, thenThreadVariable.Unlock. What that would do, is force all threads that tried to call ThreadVariable.Lock to wait until no other threads had the variable locked then it could proceed. Obviously the code it processes between the lock and unlock should be as quick and effecient as possible so it does not create a major traffic jam.

Because my thinking is this "object" I am referring to as being in memory, most likely will play a big role in answering the question about getting the requests in a "one at a time" situation it may be the focus of the question is more like how would I create "an object" and store it in memory to be quickly and easily accessed?

And even more generically does this even sound like I am on the right track

I think the topic of "communication to and from users" will need to be a completly different thread.

View 5 Replies


Similar Messages:

Multithreading - How Are Threads Tied To Requests Through Http.sys, IIS

Jan 29, 2011

I'm currently reading a lot about node.js. There is a frequent comparison between servers using a traditional thread per request model (Apache), and servers that use an event loop (Nginx, node, Tornado).

I would like to learn in detail about how a request is processed in ASP.NET - from the point it is received in http.sys all the way up to it being processed in ASP.NET itself. I've found the MSDN documentation on http.sys and IIS a little lacking, but perhaps my google-fu is weak today. So far, the best resource I have found is a post on Thomas Marquardt's Blog.

Could anyone shed more light on the topic, or point me to any other resources?

View 1 Replies

C# - Synchronize Count Down Time For All Users?

Mar 15, 2010

I need to synchronize the count down time for all users.So it will display identical remaining time to all in asp.net.

View 1 Replies

Web Forms :: Possible To Synchronize Video With Presentation Slides

Jun 22, 2010

I found a good website to show presentation with video and slides at the same time. The video is nicely synchronized with the slides. I would like to know whether it can be done in ASP.NET web form. If yes, how to do it? What is the logic to implement this feature?

View 3 Replies

Forms Data Controls :: Synchronize GridView With Database After Changes?

Jan 31, 2010

I have a Gridview that is populated with and ObjectDataSource set up to allow anonymous users to populate it. After logging in, the database is filled with the Gridview's data using the following:

[Code]....

The database's primary Key is filled by the "lblItemID" string at the beginning of the loop.

deleting the item from the database keying on this primary key. The gridview deletes the proper row using it's DeleteMethod, but obviously I don't have it set up properly to delete the same PK row from the database.

I really don't want to mess with the DataSource's DeleteMethod (and I'm not sure if this would help at all anyway), so is there a way to look for these deleted ItemId's and remove them from the database while executing this Loop statement?

View 1 Replies

Selectively Redirecting HTTP Requests To HTTPS Requests?

Jun 18, 2010

What's the simplest and most effective way to selectively redirect HTTP requests to your ASP.NET page to its HTTPS equivalent? For example, if my page site URL is [URL], I want to redirect some (or all) page requests to [URL] What's the easiest way to do that?

View 2 Replies

Architecture :: How To Synchronize The Data With Server

Jun 23, 2010

I have the following scenario:

A server with a number of different clients on different networks. Clients will have to synchronize data with the server.

Just imagine we have a simple data table on the server. The client has the same table schema and works locally but at a certain time of the day it must upload and synchronize with the server.

Was thinking maybe in doing the following. On the client have two extra columns:

Ej:

- synchronized (Boolean, default to false)
- Time it was synchronized (date time).
- Have a wcf service on the server.

Whenever it needs to synchronize it calls the service. The service then updates data on the server. The client will wait for a response which will inform whether the synchronization took place or not. If it did it updates its local table, setting synchronized to true and the time.

View 4 Replies

Equivalent Of The Synchronize Block In Java?

Mar 30, 2011

Possible Duplicate: C# version of java's synchronized keyword?

I know that when working with a session in Java, you were always supposed to surround use of the session with a synchronized block incase the user would load your page with two browsers at the same time.

View 1 Replies

C# - Synchronize SessionID Over Multiple Second-domain Servers?

Jan 13, 2010

how can I synchronize sessionID over multiple second-domain servers? For example, I've got servers(you can log-in into server swarm at any of these), [URL], [URL], [URL] and if you log in at one of them, the login information (+anything else) should persist along them. How can I provide SessionID to other domains? (session itself is stored on sql server shared across the services).

View 2 Replies

DataSource Controls :: Can Synchronize The Design Of Two Databases

Jan 17, 2010

I used the Database Publishing Wizard to create a copy of my live SQL Server database for testing purposes. Both the live and test databases are hosted by my ISP.

What is the easiest way to transfer design changes from one database to the other without altering the data (assuming that the design changes are compatible with the existing data in the target database)?

Any proposed solution would have to be available via Visual Web Developer 2008 Express or SQL Server 2008 Development Edition.

View 11 Replies

SQL Server :: How To Synchronize Offline/online Database

Feb 3, 2011

I want to merge a software with a website.I have no source code of software, but i want to the database of online data and offline data will automatically synchronize. I have only control over website, online database and offline database.. Is it possible, if yes how?

[code]....

but when i feed data in offline database, online database automatically updated.

View 5 Replies

DataSource Controls :: Synchronize Data In 2 Tables?

Jan 6, 2010

I need to synchronize data between 2 tables. i need to update records on table2 corresponding to table1. I also need to add new records in table2 by getting new records from table1.

View 2 Replies

Web Forms :: Implementing The Threadpool Concept And Have Doutbt In Threads Being Created

May 14, 2010

Am implementing the threadpool concept and have doutbt in threads being created.

[Code]....

Initially i gave (1,1) in semaphores and only one thread was created and it did only one task, and (5,5) created one thread and it used for all the times.

Is ter anything wrong in wat i did or any other way of doin other than semaphores. And mainly wat abt the remaining 20 threads in threadpool? its a waste of CPU right. Can i create only 5?

View 6 Replies

DataSource Controls :: Synchronize Or Able To Retrieve Information From One Database To Another One?

Jun 8, 2010

I'm using Content Management System, DotNetNuke for my dynamic website. DNN itself they have one database, I named it dnnDB. Inside the dnnDB they have the users table which have the list of users. I need to be able to pull this set of information or synchronize to my own database, myDatabase for development purposes. I do not want to incorporate my database into dnnDB, afraid that I may corrupt the system.

View 4 Replies

How To Manage Threads In A C# Web App

Jan 6, 2011

I built a little web application that displays charts. I was thinking that it might be useful for the superuser of the app to do a complete data refresh, however this process takes around 10 minutes to complete. I was thinking perhaps the user could click a button that would start off a new thread to do a data refresh and subsequent clicks would kill the thread and restart the data population process. The user would then be free to browse about the site and view the charts as their data is populated.

Is there a simple method of accomplishing something like this?

View 3 Replies

Trying To Get A Better Handle On How Threads Work?

Aug 20, 2010

I'm trying to get a better handle on how threads work in ASP.NET, so I have a test site with a few pages, and I have a test WinForms client that creates 40 roughly concurrent requests to the test site. The requests take about 5-10 seconds to complete--they call a web service on another server. When I run the test client, I can use Fiddler to see that the requests are being made concurrently. However, when I look at Performance Monitor on the web server, with counters "ASP.NET Apps v2.0.xxx/Requests Executing", "ASP.NET/Requests Current", "ASP.NET Requests Queued", these counters never display more than 2.

This is the case regardless of whether the test page I'm requesting is set up with Async=True and using the Begin/End pattern of calling the web service, or if it's set up to make the call synchronously. Judging by what I see in Fiddler, I would think I should be seeing a total of 40 requests in one of those states, but I don't. Why is that? Do these counters not mean what I think they mean?

View 1 Replies

How To Share Data Between Threads

Nov 1, 2010

In the main thread I open a new thread that gets the number of new messages of user (takes about 5 secs) and this second thread should save the number in some place.

In the main thread I should check the "some place" and if the value exists I display it on the page.

Where can I save the value from the second thread to read it from the main one? This value is unique per user so I can't use static field.

View 3 Replies

C# - AsParallel() - With More Than 2 Threads In Parallel?

Feb 21, 2011

I have a method that I call 8 times with different parametres.I use

AvailableYears.AsParallel()
.Select<Int32,DateUsedByThread>(x => GetDataForYearWorker(x,CIF))
.ToList();

GetDataForYearWorker gets the response from a webservice synchronously. It uses very little computing power on my asp.net application, but it ussualy takes 3-5 sec for each webservice response. Because the calls to the webservice are independent of eachother, I want to make tham all at the same time. But it looks like only 2 threads can run at the same time. Why is this and how can I have 8 threads working at the same time?

View 1 Replies

C# Execute 2 Threads Simultaneously?

Feb 27, 2011

I am trying to reproduce a threading error condition within an HTTP Handler.

Basically, the ASP.net worker procecss is creating 2 threads which invoke the HTTP handler in my application simultaneously when a certain page loads.

Inside the http handler, is a resource which is not thread safe. Hence, when the 2 threads try to access it simultaneously an exception occurs.

I could potentially, put a lock statement around the resource, however I want to make sure that it is infact the case. So I wanted to create the situation in a console application first.

But i cant get 2 threads to execute a method at the same time like asp.net wp does. So, my question is how can you can create 2 threads which can execute a method at the same time.

Edit:

The underlying resource is a sql database with a user table (has a name column only). Here is a sample code i tried.

[TestClass]
public class UnitTest1
{
[TestMethod]
public void Linq2SqlThreadSafetyTest()

[Code]....

View 1 Replies

Wcf - Update Value In TextBox From Other Threads?

Mar 5, 2011

I'm using ASP.NET 4.0 on IIS7.5 and WCF Callback technique. I have no problem with callback. The wcf service can fire callback method in web client but it seems it's on another thread with the UI thread.

public partial class _Default : System.Web.UI.Page, IServiceCallback
{
private IService proxy = null;
private static TextBox _textBoxtest;
protected void Page_Load(object sender, EventArgs e)

[Code]....

how to update my textBox from callback event.

View 2 Replies

Iis - Web Garden - Max Worker Threads?

Oct 5, 2010

I'm investigating some performance improvements that can be made to our web server and ASP.NET application.This page contains a few things that we can do.We currently have two worker processes running as a garden. Do each of these worker processes have their own ASP.NET threadpool? Or do both of these worker processes share a single threadpool and the max number of worker threads is shared across these processes?This post seems to suggest that the two processes share a common ASP.NET threadpool. All w3wp.exe threads do is take requests from HTTP.SYS queue, process it, and hand the request toASPNET_ISAPI.DLL, who then deposits those requests into the ASP.Net request queue, and the ASP.Net threadsBut this post suggests that each worker process contains their own ASP.NET threadpool. Each process (w3wp.exe) has its own CLR thread pool which has the configured maxworkerthreads value (20 default).

View 1 Replies

Working With Threads On Pageload?

Feb 15, 2011

When my asp.net page loads,it needs to get data from 2 webservices.I want to make the data retrieval processes work concurently.How can I do this and update Label1 with the text result from WS1 and label2 with the result from WS2?I don't know how the code should look like in order to be able to update the controls on the page.

View 1 Replies

Asp.net - Is HttpModule Shared Among Working Threads

Apr 11, 2010

Do I have to lock access to instance members?

public class HttpModule : IHttpModule
{
//...
Dictionary<int, int> foo;
void UseFoo(int a, int b)
{
foo[a] = b;
}
}

View 2 Replies

Exception Handling In Background Threads?

Jun 15, 2010

When I do ThreadPool.QueueUserWorkItem, I don't want unhandled exceptions to kill my entire process. So I do something like:

ThreadPool.QueueUserWorkItem(delegate() {
try { FunctionIActuallyWantToCall(); }
catch { HandleException(); }
});

Is this the recommended pattern? It seems like there should be a simpler way to do this. It's in an asp.net-mvc app, if that's relevant.

View 1 Replies

Security :: CurrentPrincipal In Background Threads?

Dec 20, 2010

I have a web application hosted in IIS 7.5 and expose its functionality using web services. The web application has state the the first thing I do is to call a web service method to start it all up. As a consequence several threads are created and these threads run until the system is stopped. All recycling of application pools and such is disabled! To access the web services the calling client must authenticate (using basic auth and local windows users). Thus, an incoming request has the CurrentPrincipal set. The logging subsystem is setup to tag all log messages with the current principals identity name and this works just fine for code that runs on an the thread of on incoming request. But, it doesn't work at all for all of my background threads. The current principal is still set in these threads but the identity objects name has been disposed. Why is this? What can I do to fix this. I would really like to get all log messages tagged with the current principal. It also seems impossible to detect if the identity name instance has been disposed without trying to access it and catch the exception which is highly annoying.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved