Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #933

Re: The threading specs in the standard: a new catastrophe

From Alexander Terekhov <terekhov@web.de>
Newsgroups comp.std.c, comp.programming.threads, comp.unix.programmer
Subject Re: The threading specs in the standard: a new catastrophe
Date 2011-07-11 13:38 +0200
Organization A noiseless patient Spider
Message-ID <4E1AE0B9.E522A035@web.de> (permalink)
References (5 earlier) <3de2d9ab-e52a-4eb3-a726-b5bed4ce7eef@q1g2000vbj.googlegroups.com> <a4b696f0-5d1a-4e7a-8988-981c82a89969@e18g2000vbx.googlegroups.com> <iv9c77$5dj$1@dont-email.me> <4E184289.9D95CABB@web.de> <i_pSp.12616$Kd6.11611@newsfe05.iad>

Cross-posted to 3 groups.

Show all headers | View raw


"Chris M. Thomasson" wrote:
> 
> "Alexander Terekhov" <terekhov@web.de> wrote in message
> news:4E184289.9D95CABB@web.de...
> [...]
> 
> >      named_windows_mutex_trick guard(this);
> 
> IIRC, that trick uses something like this to generate a name for the mutex:
> _____________________________________________________
> std::string
> win_static_init_generate_name(
>     void const* ptr
> ){
>     DWORD pid = GetCurrentProcessId();
>     DWORD_PTR oid = (DWORD_PTR)ptr;
> 
>     std::stringstream name_buf;
>     name_buf << "SINIT_" << pid << "_" << oid;
> 
>     return name_buf.str();
> }
> _____________________________________________________
> 
> Right?

Right.

http://lists.boost.org/Archives/boost/att-92840/once_mutex.hpp

std::string create_unique_name(void* p,const char* tag)
{
    std::ostringstream res;
    res<<"unique-"<<tag<<"-name-{C15730E2-145C-4c5e-B005-3BC753F42475}-"
       <<p<<"-"
       <<::GetCurrentProcessId();
    return res.str();
}

regards,
alexander.

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: The threading specs in the standard: a new catastrophe jameskuyper <jameskuyper@gmail.com> - 2011-07-07 15:25 -0700
  Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-07 16:12 -0700
    Re: The threading specs in the standard: a new catastrophe James Kuyper <jameskuyper@verizon.net> - 2011-07-07 22:41 -0400
    Re: The threading specs in the standard: a new catastrophe "Chris M. Thomasson" <cristom@charter.net> - 2011-07-08 12:47 -0700
      Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-08 13:11 -0700
        Re: The threading specs in the standard: a new catastrophe "Chris M. Thomasson" <cristom@charter.net> - 2011-07-08 16:56 -0700
        Re: The threading specs in the standard: a new catastrophe Marcin Grzegorczyk <mgrzegor@poczta.onet.pl> - 2011-07-09 23:55 +0200
          Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-09 18:40 -0700
  Re: The threading specs in the standard: a new catastrophe jacob navia <jacob@spamsink.net> - 2011-07-08 01:16 +0200
    some sane words, for sure "Greg A. Woods" <woods@robohack.org> - 2011-07-07 18:33 -0700
    Re: The threading specs in the standard: a new catastrophe jameskuyper <jameskuyper@gmail.com> - 2011-07-08 08:34 -0700
      Re: The threading specs in the standard: a new catastrophe sfuerst <svfuerst@gmail.com> - 2011-07-08 10:47 -0700
        Re: The threading specs in the standard: a new catastrophe James Kuyper <jameskuyper@verizon.net> - 2011-07-09 06:57 -0400
          Re: The threading specs in the standard: a new catastrophe Alexander Terekhov <terekhov@web.de> - 2011-07-09 13:59 +0200
            Re: The threading specs in the standard: a new catastrophe jacob navia <jacob@spamsink.net> - 2011-07-09 14:45 +0200
            Re: The threading specs in the standard: a new catastrophe "Chris M. Thomasson" <cristom@charter.net> - 2011-07-10 15:47 -0700
              Re: The threading specs in the standard: a new catastrophe Alexander Terekhov <terekhov@web.de> - 2011-07-11 13:38 +0200
            Re: The threading specs in the standard: a new catastrophe Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-07-11 16:12 +0300

csiph-web