Ask a Question related to ASP.NET General, Design and Development.
-
David #1
are static functions threadsafe?
I have a static method in the dll that looks like this
public static int myStaticFunction(int input){
}
My question is, should I use a mutex inside the function to ensure that the
function is threadsafe? This is used for ASP.NET. I am asking this
question without knowing how IIS works as a multi-threaded application.
Does each websession get a thread? If so, if two users are calling the
static function at the same time, do they
- act as two seperate threads?
- If so, are static functions threadsafe?
David Guest
-
#40765 [NEW]: calling backtrace inside nested static class functions causes segfault
From: ndroege at bimp dot de Operating system: linux debian PHP version: 5.2.1 PHP Bug Type: Reproducible crash Bug... -
#39713 [NEW]: Static variables defined in static methods duplicated in derived classes
From: paul at digitalbacon dot us Operating system: Linux, Mac OS X 10.4, Windows XP PHP version: 5.2.0 PHP Bug Type: ... -
#38783 [NEW]: Call to non-static as static E_STRICT thrown when error reporting set to E_ALL
From: dmb27 at cornell dot edu Operating system: Redhat AS 4 PHP version: 5.1.6 PHP Bug Type: Class/Object related Bug... -
[RFC] Thread::MappedQueue - threadsafe queue with mapped responses
Concept for a new Thread module, looking for feedback, or if I've overlooked an existing module that already does this, or if there's a better name... -
PHP5 and static functions/vars
Hi, I need to add a string to a class var, but it doesn´t work though I read it is a new feature in PHP5. This is my code: class Huh{ static... -
Marina #2
Re: are static functions threadsafe?
They are not thread safe, and you need to synchronize them.
There will be a separate thread for each user accessing the web server.
"David" <nospam@nospam.com> wrote in message
news:2viVa.12144$j%4.512912@twister.socal.rr.com.. .the> I have a static method in the dll that looks like this
>
> public static int myStaticFunction(int input){
> }
>
> My question is, should I use a mutex inside the function to ensure that> function is threadsafe? This is used for ASP.NET. I am asking this
> question without knowing how IIS works as a multi-threaded application.
> Does each websession get a thread? If so, if two users are calling the
> static function at the same time, do they
> - act as two seperate threads?
> - If so, are static functions threadsafe?
>
>
Marina Guest
-
David #3
Re: are static functions threadsafe?
Thank you. My friend and I have been debating this. Is there some
documentation you could point me to?
"Marina" <mzlatkina@hotmail.com> wrote in message
news:OUSR7HWVDHA.1744@TK2MSFTNGP12.phx.gbl...> They are not thread safe, and you need to synchronize them.
>
> There will be a separate thread for each user accessing the web server.
>
David Guest



Reply With Quote

