Lock Free

| 2 Comments

I'm currently looking at "lock free" access to the linked list that stores the set of clients to communicate with. Ideally we'll be able to add to, delete from and traverse the list from multiple threads without needing to lock and synchronise. There are lots of references available, so far these two (1 and 2) look good from a quick scan of them whilst they were printing... Wish I'd kept up my ACM membership as it looks like the definitive works are available as conference proceedings on their site (then again, I often find that the definitive work isn't necessarily the best starting point).

I know that if I get this working here then "SenderX" from the Winsock newsgroups is going to pester me to add it to the rest of the framework's locking list manipulation.

More as it happens...

2 Comments

Use one thread. Your problems will be solved. ; )

Hmm...

I expect our approach to threading these servers is actually much more similar than you'd expect ;) Even though you only have a single thread... The IOCP model means that I have several threads which get alerted when IO operations complete (much like having several threads waiting on the same select) - the advantage is that the IOCP mechanism allows me to use all available processors in the machine and also manages how many threads it releases, and how they're released so that context switching is reduced... The downside is that I need data structures that handle concurrent access if connection A needs to talk to connection B...

Still, I have a plan...

Leave a comment