Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts

    Mutexes in Javascript?

    Hi all,

    I would like to implement a gracefull mutex class - by gracefull I mean a mutex that avoids the kind of race hazards and CPU hammering that occur with simple code that loops like crazy until a flag is raised in another thread (AKA the newbie programmer's Mutex!).

    In other words, how do I implement an atomic silent wait state with a timeout in javascript? Is there a built-in to do it or will I have to write it myself? I know how to do this in Assembly, C, C++, Java, Lisp and PHP but not Javascript!

    I'm using AJAX, so perhaps there's a builtin within the AJAX object itself?

    Many thanks,

    Mike.
    Last edited by mlse; 05-23-2008 at 12:02 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •