FLTK logo

Re: [fltk.general] Fl_Preferences instead of boost::interprocess

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Fl_Preferences instead of boost::interprocess "'Matthias Melcher' via fltk.general" Nov 23, 2021  
  IIRC the easiest way to create dynamic libraries in VS is by using CMake to generate the VS Solution.

Also, linking to FLTK dynamically is (these days) only useful if an app must link to it multiple times, for example, if the app has plugins, and each of the plugins needs to link to FLTK. By linking dynamically in this case, the OS makes sure that all plugins link to the same *process* instance of FLTK. The main process must also link *dynamically* to FLTK it this case.

If linking statically to multiple libraries, which in turn need FLTK, you'd also link FLTK statically, so all references to FLTK can be resolved at runtime.

In all cases, global FLTK variables are visible in all dynamically linked plugins and/or static libraries, and they are all the exact same instance, and that works on all platforms. 

The above is true for every single *process*. *Threads* OTOH all live within a process and share global memory. Multiple threads inherit the global space of their parent thread. So, yes, multiple threads have access to all FLTK global variables, no matter if FLTK was statically or dynamically linked. FLTK defines a lock (fl_lock(), fl_unlock()) that can be used by all threads within an app to synchronise FLTK access.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/4e17df63-2511-4af0-8109-0a272f99e831n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.