Help - Search - Member List - Calendar
Full Version: Atmoic operations in Multi-threaded Perl?
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
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

Dave Gray
On 7/6/05, Siegfried Heintze <[Email Removed]> wrote:
QUOTE
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:
<http://www.perlmonks.org/index.pl?node_id=288022>
<http://search.cpan.org/~nwclark/perl-5.8.7/ext/threads/shared/shared.pm>

Siegfried Heintze
How do I programmatically and gracefully exit a TK GUI program? I was
looking for a close function for MainWindow, but could find none.

Thanks,
Siegfried

Zentara
On Wed, 13 Jul 2005 20:20:30 -0600, [Email Removed] (Siegfried
Heintze) wrote:

QUOTE
How do I programmatically and gracefully exit a TK GUI program? I was
looking for a close function for MainWindow, but could find none.

Tk::exit;
or
exit;

Like
$mw->Button(-text=>'Exit', -command=>sub{exit})->pack();


--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.