Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Locking mach-ii properties (thread-safety)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Po  
View profile  
 More options May 8 2012, 12:48 pm
From: Po <fermar...@gmail.com>
Date: Tue, 8 May 2012 09:48:21 -0700 (PDT)
Local: Tues, May 8 2012 12:48 pm
Subject: Locking mach-ii properties (thread-safety)

As I was exploring some of Mach-II's code on Github, I noticed that if I
(hypothetically) happen to call the setProperty method from my app at some
point during the request to set a property to "A" if someTempFlag is true,
or to "B" if someTempFlag is false, I could then be causing race conditions
when there are multiple concurrent requests since there is no locking
implemented in the PropertyManager.cfc (nor in other component that calls
the setProperty method that I could find).

Is there a reason for this, or is this never really an issue in your
experience? (or maybe I am just completely misunderstanding something)

Thank you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Po  
View profile  
 More options May 8 2012, 12:50 pm
From: Po <fermar...@gmail.com>
Date: Tue, 8 May 2012 09:50:50 -0700 (PDT)
Local: Tues, May 8 2012 12:50 pm
Subject: Re: Locking mach-ii properties (thread-safety)

Or is this something that was intended to be implemented as needed at the
application level as opposed to being implemented at the framework level?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Shuck  
View profile  
 More options May 8 2012, 12:52 pm
From: Dave Shuck <dsh...@gmail.com>
Date: Tue, 8 May 2012 11:52:51 -0500
Local: Tues, May 8 2012 12:52 pm
Subject: Re: [Mach-II] Locking mach-ii properties (thread-safety)

Properties are more intended to be static values for the most part and
should never (I hate using "never", but I will stick with it in this case!)
change per request or per user.  Think of them in the same way that you
would application variables in a procedural application.  If you are
looking to set temp values, I would recommend using eventArgs as they only
span the life of the request.

@dshuck


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Po  
View profile  
 More options May 8 2012, 1:03 pm
From: Po <fermar...@gmail.com>
Date: Tue, 8 May 2012 10:03:28 -0700 (PDT)
Local: Tues, May 8 2012 1:03 pm
Subject: Re: [Mach-II] Locking mach-ii properties (thread-safety)

Yes, I completely agree that application properties should (for the most
part) not be set per request.  But I have had cases where I just needed to
set an application wide property after the app had already started.  Even
though this might not have been the best approach, at the time it was the
one that proved to be the best solution.  So regardless of whether or not
this was a poor choice, the fact is that the ability to do this still
exists.

So I guess this question now is, if one ever needs to set an application
property on request (one that is needed application wide, not just a temp
value), should they make sure that they properly lock these setProperty
calls if a race condition with a negative outcome can occur, or should this
be something that is implemented at the framework level?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Woodward  
View profile  
 More options May 8 2012, 1:10 pm
From: Matthew Woodward <m...@mattwoodward.com>
Date: Tue, 8 May 2012 10:10:55 -0700
Local: Tues, May 8 2012 1:10 pm
Subject: Re: [Mach-II] Locking mach-ii properties (thread-safety)

On Tue, May 8, 2012 at 10:03 AM, Po <fermar...@gmail.com> wrote:
> So I guess this question now is, if one ever needs to set an application
> property on request (one that is needed application wide, not just a temp
> value), should they make sure that they properly lock these setProperty
> calls if a race condition with a negative outcome can occur, or should this
> be something that is implemented at the framework level?

You should lock that yourself since it's an edge case as far as the
position of the framework is concerned.

--
Matthew Woodward
m...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Shuck  
View profile  
 More options May 8 2012, 1:12 pm
From: Dave Shuck <dsh...@gmail.com>
Date: Tue, 8 May 2012 12:12:20 -0500
Local: Tues, May 8 2012 1:12 pm
Subject: Re: [Mach-II] Locking mach-ii properties (thread-safety)

If you mean you just want to set something programatically as the
application is being bootstrapped and keep it threadsafe, the configure()
methods of plugins/listeners/filters are threadsafe.    I have been known
to have plugins who's whole purpose of existing is to
set programmatic properties at startup and only contain a configure()
method.  In all my years of writing Mach-II applications, I have never
really found a reason that I need to change properties at runtime after
bootstrapping has completed, but this is probably more because of my narrow
mindset that they are "static" variables in my applications.  Nothing would
prevent you from implement locking yourself though.

@dshuck


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Po  
View profile  
 More options May 8 2012, 1:15 pm
From: Po <fermar...@gmail.com>
Date: Tue, 8 May 2012 10:15:34 -0700 (PDT)
Local: Tues, May 8 2012 1:15 pm
Subject: Re: Locking mach-ii properties (thread-safety)

Thank you both for your replies.  I figured this was an edge case, but just
wanted be sure.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »