locked
threads and handlers what will be the result in such a case RRS feed

  • Question

  • User1652530521 posted

     There is an handler that receives 2 requests simultaneously and each request comes with different values in the querystring.

    One qs contains the word 'abracada' and the other qs contains 'cada'. The handler returns the value of the QS.

    The handler has thread.sleep that sleeps for a few secs. It is random -example one request can be delayed for 2 secs and the other for 3 secs.

    Is it possible that this will cause confusion with the threads and the request that came with qs='cada' will return 'abracada' instead of 'cada'?

    Thanks

    Tuesday, July 3, 2018 7:16 AM

All replies

  • User753101303 posted

    Hi,

    No. Most often this kind of behaviour is caused by using static data (causing a single value being shared across all http requests).

    Tuesday, July 3, 2018 7:55 AM