>- see footer for list info -<
I was talking about using a transaction when checking my
aforementioned database table. Which would prevent the process
accidentally running concurrently.

I prefer using the database instead of cflock as it is monitorable and
persistent so it can work in a clustered environment.

On Thu, Jul 10, 2008 at 10:44 AM, Adrian Lynch
<[EMAIL PROTECTED]> wrote:
>>- see footer for list info -<
> Well, not really. Transactions work on the DB, what about a block of code?
>
> Adrian
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Simon Baynes
> Sent: 10 July 2008 02:12
> To: Coldfusion Development
> Subject: Re: [CF-Dev] Semaphores in CF
>
>
>>- see footer for list info -<
> That is why you would use a transaction, therefore no problem!
>
> On Wed, Jul 9, 2008 at 3:24 PM, Nick Middleweek
> <[EMAIL PROTECTED]> wrote:
>>>- see footer for list info -<
>> That would work in general but there may be times when the same piece of
>> code runs at exactly the same time. and therefore both processes think
>> they've got 'hold' over the code block.
>>
>> Read the last paragraph on the Example Usage for info on binary semaphores
>> and mutex: http://en.wikipedia.org/wiki/Semaphore_%28programming%29
>>
>> The 4D language has the perfect command set to handle semaphores:
>> http://www.4d.com/4ddoc2004/CMU/CMU00143.HTM
>>
>>  - I've noticed the optional tickcount parameter in 4D's Semphore command
>> being WaitingTime. I guess this is equivalent to the CFLOCK's timeout
>> parameter.
>>
>>
>> Cheers,
>> Nick
>>
>>
>>
>>
>> 2008/7/8 Snake <[EMAIL PROTECTED]>:
>>
>>> >- see footer for list info -<
>>> Or set a flag in a server variable so you know if the schedule is
> running.
>>>
>>> Russ
>>>
>>> -----Original Message-----
>>> From: [EMAIL PROTECTED]
>>> [mailto:[EMAIL PROTECTED] On Behalf Of Simon Baynes
>>> Sent: 08 July 2008 18:02
>>> To: Coldfusion Development
>>> Subject: Re: [CF-Dev] Semaphores in CF
>>>
>>> >- see footer for list info -<
>>> Why don't you just use your database? Have a table with some flags in it!
>>>
>>> On Tue, Jul 8, 2008 at 5:53 PM, Nick Middleweek
>>> <[EMAIL PROTECTED]> wrote:
>>> >>- see footer for list info -<
>>> > Hello,
>>> >
>>> > Does anyone know if we can use Semaphores?
>>> >
>>> > I have a page being executed from the CF scheduler to do X&Y which will
>>> take
>>> > some time depending on files to process.
>>> >
>>> > I only want the code to run X&Y at one time so if the scheduler kicks
> the
>>> > code off again while the previous 'process' is running I want the new
>>> > process to gracefully exit.
>>> >
>>> > In 4D I would use a Semaphore. A developer here has said about using
>>> CFLOCK
>>> > and put all code to be executed once between the tags; but I'm a little
>>> > unclear on it's usage...
>>> >
>>> > I am right thinking that I can set the CFLOCK timeout settting to "1"
> and
>>> > then set throwOnTimeout = "no" so that the new process will wait for
> one
>>> > second to gain the lock and then drop out naturally without executing
> any
>>> > code between the CFLOCK tags?
>>> >
>>> > Hope that makes sense.
>>> >
>>> > Cheers,
>>> > Nick
>
>
> _______________________________________________
>
> For details on ALL mailing lists and for joining or leaving lists, go to 
> http://list.cfdeveloper.co.uk/mailman/listinfo
>
> --
> CFDeveloper Sponsors:-
>>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>- Lists hosted by www.Gradwell.com -<
>>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
>



-- 
Simon Baynes
www.simonbaynes.com
LinkedIn profile:- http://www.linkedin.com/in/simonbaynes

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to