[m-users.] Global variables that are local to the thread
Volker Wysk <[email protected]> Sun, 05 Nov 2023 16:40:16 +0100
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Hi! I'm considering to build a new version of the ODBC library, that's thread- safe. There's a point which I don't understand yet. The ODBC library has a number of global variables. For instance, the ODBC environment handle. This makes it thread-unsafe. Can these variables be made local to the thread, while still being global, so all foreign procedures in the same thread can access it? Or do I need to introduce a new argument of some new type odbc_data, which is to be passed to all predicates of the library? This type would hold all the formerly global data, but it would be burdensome to pass it around all the time. Maybe use a thread-local mutable variable? Cheers, Volker _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users