Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Why do STREAMS need to ensures that there is only one user-driven M_IOCTL operating on a stream
Thanks again.
I can't understood what you said completely, so I will take a instance
to express what I understood about you said above, would you please
check it for me? Thanks very much.

There is a process with two threads: T1 and T2
A STREAMS driver and its corresponding device file is /dev/XXX

situation 1:
T1 and T2 both issue ioctl(fd, ...) at the same time, and the fd is a
glable variable in the process. Because of the same fd, these two
ioctls will execute on the same stream, they won't be executed
concurrently.

situation 2:
Different from situation1, the fd is not a glable variable, but be got
by open(/dev/XXX, ...) separately in T1 and T2. Because of the
different fd, these two ioctls will execute on the different stream
even though they are on the same driver, they can be executed
concurrently, these two ioctls can arrive to the driver at one time on
different CPU and different stream.

James Carlson wrote:
> "tony" <nj_zxw10@hotmail.com> writes: 
>
> That's right -- choosing correctness over performance.
> 
>
> Yes, but does it matter?  As I pointed out previously, ioctls are
> supposed to be control-path operations.  If you really have multiple
> threads issuing ioctls on a *single* stream and you need to have those
> run concurrently, then perhaps ioctls aren't the right design.
>
> Note that we are talking about per-stream operation here.  If you have
> multiple streams, they're independent, so you can have multiple ioctls
> taking place in a single module -- each on a separate stream.  It
> isn't as though it's one ioctl per _module_.
>
> --
> James Carlson, KISS Network                    <james.d.carlson@sun.com>
> Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
> MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677


Report this thread to moderator Post Follow-up to this message
Old Post
tony
07-14-06 02:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:27 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.