Boost logo

Boost :

From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2007-04-20 23:10:11


Gottlob Frege wrote:
[snip]
> That's the threadsafety problem.

I'm starting to get the impression that this is all a problem with the
term "make" in make_c_function. People are reading more into that term
than I do. The utility doesn't create anything new, in the allocation
sense, it gives you a tagged function. It happens to provide a
convenient interface for associating it a singleton function object.

But at least I understand what Steven's point/use is now :-)

> So, it's OK for some uses, and maybe using tags you could keep track
> of your uses better (ie this thread always uses this tag, etc),

Yes. And unless you do some serious code generation magic this the only
possible use you can achieve with the static binding model of C/C++. (in
the symbol binding sense)

> but if
> you are dynamically creating threads (ie 1 per server request, etc),
> then this can't easily be used.

Correct. And I never designed it for that. My use case is for creating
one time bindings for plugins, i.e. function tables that map to C++
singletons.

And yes, I wish it where also possible to just make free floating C
functions. But that's not easily possible, since you can't make existing
C function pointers bigger at will.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk