Re: Non blocking spin lock..




"Chris Thomasson" <cristom@xxxxxxxxxxx> wrote in message
news:m8adnUiN9Jiwsa3bnZ2dnUVZ_gKdnZ2d@xxxxxxxxxxxxxx
"David Schwartz" <davids@xxxxxxxxxxxxx> wrote in message
news:1177394029.411699.91440@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 23, 6:59 am, "cwarwick" <warw...@xxxxxxx> wrote:

My apologies if this post appears twice. My first post didn't appear,
and I didn't keep a copy of it. So this is the same information
presented differently.

Anyway here's my lock object.. (just the implementation.)

It takes years of experience to write correct multi-threading
synchronization primitives. You've basically made every mistake.
That's fine if you're learning, but do not deploy this code.

Heck! I did not know that this was an x86 assembly language question!

;^)

AFAICT, his trylock scheme should work... Also, to the OP:

Why not just use pthread_mutex_trylock?

Well im using Delphi so i dont think it has PThreads, also all i know next
to nothing about them. The most i've done before now is to use an occasional
background thread chrunching some numbers while the main thread shows a
progress bar or graph or somthing. In which case i just paused the
background thread while i accessed the data.




--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • 2.6.0-test5 atkbd.c: Unknown key (100% reproduceable)
    ... [My first post didn't make to the list. ... Apologies if it appears twice] ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Three Station Tracking - Altitude Only Method
    ... Apologies in the event that this post appears twice. ... I did see the first post. ... and I apologize for thanking ...
    (rec.models.rockets)
  • Re: Non blocking spin lock..
    ... "David Schwartz" wrote in message ... My apologies if this post appears twice. ... My first post didn't appear, ...
    (comp.programming.threads)
  • Re: 944 Turbo rear valance
    ... Apologies. ... Not only do I crosspost the OP, ... the whole of urh now knows what I ... > Not to mention that it wasn't your first post to urh. ...
    (uk.rec.humour)
  • Default/editable string to raw_input
    ... This is my first post to the list, I hope somebody can help me with this problem. ... Apologies if it has been posted before but I have been internet searching to no avail. ... What I am trying to do is provide a simple method for a user to change a config file, ... The config file consists of a number of keys, eg. build number, target device, etc. ...
    (comp.lang.python)