Hi, ---------- Původní zpráva ---------- Od: Ján Veselý <[email protected]> Datum: 26. 6. 2013 Předmět: Re: [HelenOS-devel] circular buffer implementation
"hm, can someone shed some light whether this is due to a conscious decision or a lack of initiative? "" """ I have already given this some thought in the past. There are two basic ways to write ADTs in a multithreaded world. Either you ignore the multiple threads and let it up to the user of the structure to provide mutual exclusion. Or you provide some synchronization guarantees within the structure itself. While there is more or less just one way of writing a single threaded ADT (e.g. a hash table), there are a plethora of ways to synchronize access to it - from one big lock (TM) to a very concurrent, lock-free, wait-free (etc.) implementation. In most cases you don't need concurrent access and the one-big-lock implementation does not bring much since in the majority of cases you already have synchronization of access to the structure where this ADT is contained. It follows that normally you want to have a full complement of single- threaded ADTs plus you might create a concurrent one based on specific need. Also synchronized data structures may vary by the synchronization mechanism they use (fibril? thread?). The only case where it seems synchronization in ADT is more useful is specifically when you need blocking operations (such as in instances of the producer-consumer problem). Just my 2c. Cheers, Jiri
_______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
