Re: Multiple netgraph threads
- From: Alexander Motin <mav@xxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 12:49:26 +0300
Hans Petter Selasky wrote:
Have you thought about nodes that lock the same mutex must be run on the same thread else for example one thread will run while another will just waits for a mutex ?
Usually different nodes does not share data, keeping them inside node/hook private data, so I don't see problem here. It is possible that two messages will be queued to the same node at same time, but to fulfil serialization requirements each node queue processed only by one thread at a time, so there is no place for congestion.
You can achieve this by grouping nodes into a tree, and the node at the top of the tree decides on which thread the nodes in the tree should be run.
Netgraph graphs usually not linear and it is from hard to impossible to predict the way execution will go and the locks that may be congested. Including usually big number of nodes and usually small lock time, congestion probability IMHO looks insignificant comparing to additional logic overhead. If some node/hook needs big lock time it may be instead declared as FORCE_WRITER to enqueue congested messages instead of blocking them (such way now implemented all existing ppp compression/encryption nodes).
--
Alexander Motin
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Multiple netgraph threads
- From: Alexander Motin
- Re: Multiple netgraph threads
- From: Hans Petter Selasky
- Multiple netgraph threads
- Prev by Date: Re: Multiple netgraph threads
- Next by Date: Re: Multiple netgraph threads
- Previous by thread: Re: Multiple netgraph threads
- Next by thread: Re: Multiple netgraph threads
- Index(es):
Relevant Pages
|
|