Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Image handlers in ASP .NET

Image handlers in ASP .NET

Scheduled Pinned Locked Moved ASP.NET
questioncsharpdatabasedata-structuresperformance
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohammad A Gdeisat
    wrote on last edited by
    #1

    Hi I have an asp .net application that uses image handlers to generate and send images to users, the image handler has the property IsReusable = true which means it is reusable for multiple requests. I have two questions: 1. When serving multiple users simultanously, are users served on strict queue basis, which means that the image handler will not be serving "multiple requests" at the same time. To clarify: what I am worried about is something like the following scenario: I have two users A and B accessing the application simultanously, I have a static varible v (in the image handler) having its value changing depending on some criteria. Now is the following scenario possible: 1. User A requests an image 2. Depending on some user criteria I set v = 1 3. User B requests another image. 4. Before finishing user A's request, ImageHandler attemps to serve user B 5. Depending on some user criteria I set v = 2 6. Imagehandler finishes serving user B. 7. Image handlers switches continue serving User A, but v = 2 (depending on user B criteria) but it should be 1. Is the above scenario possible? My second question: My Image handler reads data from a database for every image in a simple manner: 1. open connection. 2. read data. 3. close connection. But because I know that only one copy of my image handler will be running so why not just open a connection in a static constructor and leave it open instead of opening/closing connections for every request? I think it will improve performance, but I am afraid that it is not a good practice. Thanks for everybody

    And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups