You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
methods like get(), put(), nlm_request() are thread safe
all the received messages are parsed and buffered, regardless the sequence_number
one thread acts as a master while running get(), it fetches data buffers with recv(); other threads are waiting for the buffer updates or until the master thread finishes running get()
Marshal class allows mixed sequence_number values within one data buffer
Marshal class allows terminator messages to be in the middle of on data buffer
Such complicated workflow makes any performance optimizations or local code refactoring next to impossible.
Proposal
split out all the thread safe methods into one base class
create another base class with same methods but thread unsafe
configure base classes for NetlinkSocket on the fly or at the start time
Thread unsafe version features
Drop any messages with alien sequence_number
Assume that one buffer must have the same sequence_number
The terminator message is always the last in the buffer
Discussion needed
Whether to make the thread unsafe version the default (starting from 0.8).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Current status and problem desciption
get()
,put()
,nlm_request()
are thread safesequence_number
get()
, it fetches data buffers withrecv()
; other threads are waiting for the buffer updates or until the master thread finishes runningget()
Marshal
class allows mixedsequence_number
values within one data bufferMarshal
class allows terminator messages to be in the middle of on data bufferSuch complicated workflow makes any performance optimizations or local code refactoring next to impossible.
Proposal
NetlinkSocket
on the fly or at the start timeThread unsafe version features
sequence_number
sequence_number
Discussion needed
Whether to make the thread unsafe version the default (starting from 0.8).
Related
Beta Was this translation helpful? Give feedback.
All reactions