semaphore

Discussion in 'C++' started by Victor Bazarov, Jul 4, 2003.

  1. "chiew peng" <> wrote...
    > I'm new to multithread programming. Now has some doubt on it. Hope

    anybody
    > can help.
    >
    > How do use the semphore?


    A semaphore is a global variable with two (rarely more) known
    states. Threads can gain access to semaphores using some king
    of OS mechanism and check the states of the semaphores. But
    since C++ doesn't define semaphores, they are off-topic here.

    The best place to ask is comp.programming.threads.

    Victor
    Victor Bazarov, Jul 4, 2003
    #1
    1. Advertising

  2. Victor Bazarov wrote:
    >
    > "chiew peng" <> wrote...
    > > I'm new to multithread programming. Now has some doubt on it. Hope

    > anybody
    > > can help.
    > >
    > > How do use the semphore?

    >
    > A semaphore is a global variable with two (rarely more) known
    > states. Threads can gain access to semaphores using some king
    > of OS mechanism and check the states of the semaphores. But
    > since C++ doesn't define semaphores, they are off-topic here.


    They are brain-damaged (as far as THREADING is concerned).

    >
    > The best place to ask is comp.programming.threads.


    <Forward Inline>

    -------- Original Message --------
    Newsgroups: comp.programming.threads
    Subject: Re: semaphore

    chiew peng wrote:
    >
    > Hi,
    > I'm new to multithread programming. Now has some doubt on it. Hope anybody
    > can help.
    >
    > How do use the semphore?


    http://terekhov.de/downey03semaphores.pdf
    (The Little Book of Semaphores, Copyright (C) 2003 Allen B. Downey)

    Now, check out this thread (please follow the embedded links):

    http://www.mail-archive.com//msg07826.html
    (Subject: [boost] no semaphores in boost::thread)

    Try to NOT miss the following msgs of mine... I'll copy&paste only one
    of them below:

    http://www.mail-archive.com//msg07506.html
    http://www.mail-archive.com//msg07519.html
    http://www.mail-archive.com//msg08431.html

    Maciej Sobczak wrote:
    [...]
    > What about providing both (condvars and semas), but with documenting
    > known pros and cons?


    Personally, I'd have no problems with some *separate* Boost.Semas (for
    things meant to be done by the current POSIX/IPC semaphores: async-
    signal-safe unlock operation, memory-isolated synchronization) library
    with the "attached sticker" ala "Intergalactic Surgeon General's
    Warning: DON'T USE IT FOR THREADING!" (or something like that). Well,
    that would actually fit rather nicely into "The POSIX++ Vision". ;-)

    regards,
    alexander.

    --
    http://terekhov.de/your-next-book
    Alexander Terekhov, Jul 4, 2003
    #2
    1. Advertising

  3. Victor Bazarov

    chiew peng Guest

    Hai,
    I'm new to multithread programming. Now has some doubt on it. Hope anybody
    can help.

    How do use the semphore?

    Thanks
    chiew peng, Jul 4, 2003
    #3
  4. Victor Bazarov

    chiew peng Guest

    Ok, anyway thanks!

    "Victor Bazarov" <> wrote in message
    news:9_6Na.6718$...
    > "chiew peng" <> wrote...
    > > I'm new to multithread programming. Now has some doubt on it. Hope

    > anybody
    > > can help.
    > >
    > > How do use the semphore?

    >
    > A semaphore is a global variable with two (rarely more) known
    > states. Threads can gain access to semaphores using some king
    > of OS mechanism and check the states of the semaphores. But
    > since C++ doesn't define semaphores, they are off-topic here.
    >
    > The best place to ask is comp.programming.threads.
    >
    > Victor
    >
    >
    chiew peng, Jul 4, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dede
    Replies:
    0
    Views:
    570
  2. Dima
    Replies:
    0
    Views:
    2,221
  3. Frank Gerlach
    Replies:
    34
    Views:
    15,193
  4. Frank Gerlach

    Really (!) correct Semaphore

    Frank Gerlach, Nov 27, 2004, in forum: Java
    Replies:
    6
    Views:
    395
    Chris Smith
    Nov 28, 2004
  5. techi_C
    Replies:
    2
    Views:
    1,391
    Richard Bos
    Aug 10, 2006
Loading...

Share This Page