S
Simon Harvey
Hi all,
In my project I have made a number of helper methods static. As I understand
it, this will create the problem that multiple threads could access the
static method at the same time and interfere with one another.
My question is, for each static method, do I need to lock access to only one
call at a time? I've noticed that Microsofts Data Application block also
uses static methods for its data access calls - for example execute and
executeNonQuery etc. Should these methods be changed to only allow access by
a single thread at any given moment?
Perhaps there is an easier solution than this. A colleague of mine is
banging on about what a terrible performance hit this will cause but given
that the application is quite small I dont think that it will be much of a
problem.
Any suggestions on what to do would be very much appreciated
Thank you all
Simon
In my project I have made a number of helper methods static. As I understand
it, this will create the problem that multiple threads could access the
static method at the same time and interfere with one another.
My question is, for each static method, do I need to lock access to only one
call at a time? I've noticed that Microsofts Data Application block also
uses static methods for its data access calls - for example execute and
executeNonQuery etc. Should these methods be changed to only allow access by
a single thread at any given moment?
Perhaps there is an easier solution than this. A colleague of mine is
banging on about what a terrible performance hit this will cause but given
that the application is quite small I dont think that it will be much of a
problem.
Any suggestions on what to do would be very much appreciated
Thank you all
Simon