FLTK logo

Re: [fltk.general] Creating a thread safe logging widget

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: Creating a thread safe logging widget Ian MacArthur Jun 13, 2022  
 
On Sunday, 12 June 2022 at 23:37:10 UTC+1 spitzak wrote:
Modern ones I think use (small) per-thread heaps. The problem then is that allocating and freeing in different threads loses the multithreading advantage of this and may result in locking anyway.


OK, that's interesting. I haven't looked at this aspect in a good while so had no idea what was really being done in practice now.
I can see a per-thread heap being quite a neat way to duck the  issue and that probably covers the majority of typical use cases.

But in this specific case, allocating in one thread then freeing in a different thread, it does seem like that will lead to some sort of synchronization, so I guess a lock does seem likely then.
Which is a pity, as there are ways this could be made fully lock-free; though I admit they would probably be unnecessarily complex for the vast majority of cases!

--
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/14616b12-32f3-4927-b60a-ee5c929d5215n%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'.