Atmoic operations in Multi-threaded Perl?

2005-07-06 Thread Siegfried Heintze
Can I assume that an auto-increment operation on an integer value is atomic
(that is, cannot be interrupted by another thread)? This is a common
assumption in C/C++. The perl  debugger I use leads me to believe that perl
stores all integers as strings however, in spite of my efforts to force them
to integer by adding zero.

 

This would mean that an auto-increment is probably not atomic.

 

What about a string copy: is that atomic?

Thanks,

Siegfried



Re: Atmoic operations in Multi-threaded Perl?

2005-07-07 Thread Dave Gray
On 7/6/05, Siegfried Heintze <[EMAIL PROTECTED]> wrote:
> Can I assume that an auto-increment operation on an integer value is atomic
> (that is, cannot be interrupted by another thread)? This is a common
> assumption in C/C++. The perl  debugger I use leads me to believe that perl
> stores all integers as strings however, in spite of my efforts to force them
> to integer by adding zero.
> 
> This would mean that an auto-increment is probably not atomic.
> 
> What about a string copy: is that atomic?

these should get you started:



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]