4

I've an application with boost named_mutex implemented to lock multiple modules in a C++ project (Visual Studio). I need to remove all boost dependencies at all costs.

Is there any other way I can implement it? If possible in STL btw, I'm using C++11

Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084
Naresh T
  • 309
  • 2
  • 14
  • 1
    The STL is from 1994, when nobody did anything in parallel. The C++ standard library from 2014 also does not contain a notion of "process" or "inter-process"; you'll need an external library. – Kerrek SB May 28 '15 at 09:11
  • 4
    "I need to remove all boost dependencies at all costs." - why? Is your project lead a psychopath? – Richard Hodges May 28 '15 at 10:37
  • Are you trying to write your own version control system? – doctorlove May 28 '15 at 12:13
  • 2
    @KerrekSB: "1994, when nobody did anything in parallel" - really? I guess my Amiga must have been a dream then. Along with Linux and Windows NT, and various flavours of Unix dating back to the 60s. – Mike Seymour May 28 '15 at 12:23
  • @MikeSeymour: Running an Amiga and a Windows NT box next to each other doesn't count as "parallelism" :-) – Kerrek SB May 28 '15 at 16:18
  • 2
    @KerrekSB: No, but running multi-threaded programs (or multiple communicating processes) on either of those, or on the many other pre-emptive multitasking systems which were common at the time, most certainly does. The STL didn't include concurrency because it was outside its scope, not because no-one was doing it. – Mike Seymour May 28 '15 at 16:31

2 Answers2

3

There is none.

You'll have to drop down to platform specific APIs

Etc.

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633
-1

You can take a look at Intel's tbb library. It is very fast and created to help with parallel execution.

https://www.threadingbuildingblocks.org/docs/help/reference/synchronization/mutexes.htm