[NSWI004] Thread queue hurts

Jan Kytka kytka.honza at gmail.com
Thu Dec 10 12:18:34 CET 2020


Hello,

our team got a comment about ugly thread queue implementation, which was
implemented using a generic list_t macro that takes: type of list item, the
link member and name
of the new specialised struct, and expands to a new specialised struct
containing list_t
and all the methods used to work with the new struct.

I understand that this is not the most beautiful thing under the sun :-)

But anyhow, I couldn't figure out how to make the thread queue a
first-class citizen
while at the same time make it reusable by both the scheduler and the
mutex, since
they each use different link_t in the thread_t structure.

Can you maybe suggest how one would go about achieving the most beautiful
thread
queue implementation there is?

Thank you :-)

Kind regards
Jan Kytka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://d3s.mff.cuni.cz/pipermail/nswi004/attachments/20201210/13493769/attachment.htm>


More information about the NSWI004 mailing list