• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

New to web development, backend question


New Coder
when deploying my website, does the web works like threads in default,
for example, I have a global array variable (my website has low data transfer, so my global variables are not large)
does person A press a button and the array is filling with person A data
meanwhile, person B comes in and presses the same button, does the data collide or it's individual threats like?
Depends a bit of what you are using. In common backend engines and languages, each request is its own instance, so if person A is manipulating a global value of his instance, it does not affect on person b instance.
(my website has low data transfer, so my global variables are not large)
That should absolutely not be a consideration ! Either you're doing it right or you're doing it wrong, not 'halfway right' depending on usage.

I think @EkBass is right in saying with common webservers (e.g. Apache) each client request is running in their own thread and you should not worry about it. It would be very strange if one web client suddenly sees data that was entered by another web user somewhere else in the world !
But when in doubt, by all means test it out. It should not be hard to force the situation and see what happens.
Top Bottom