<div>Very nice!</div><br><br><div class="gmail_quote">2013/2/7 Peter Teoh <span dir="ltr"><<a href="mailto:htmldeveloper@gmail.com" target="_blank">htmldeveloper@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Multiple concurrent write() by different thread is possible, as they all can share the same file descriptor in a single similar process, and this is not allowed. So nevertheless, the problem you posed is not allowed/acceptable by the kernel, so Linus himself fixed it:</div>
<div><br></div><div>See here:</div><div><br></div><div><a href="http://lwn.net/Articles/180387/" target="_blank">http://lwn.net/Articles/180387/</a></div><div><br></div><div>And Linus patch:</div><div><br></div><div><a href="http://lwn.net/Articles/180396/" target="_blank">http://lwn.net/Articles/180396/</a></div>
<div><br></div><div>but my present version (3.2.0) has rcu lock over it (higher performance):</div><div><br></div><div><div> INIT_LIST_HEAD(&f->f_u.fu_list);</div><div> atomic_long_set(&f->f_count, 1);</div>
<div> rwlock_init(&f->f_owner.lock);</div><div> spin_lock_init(&f->f_lock);</div><div> eventpoll_init_file(f);</div><div> /* f->f_version: 0 */</div><div><br></div><br><div class="gmail_quote">
<div><div class="h5">
On Thu, Feb 7, 2013 at 4:44 PM, Karaoui mohamed lamine <span dir="ltr"><<a href="mailto:moharaka@gmail.com" target="_blank">moharaka@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
<div><br></div>Tahnks guys!<br><br><div class="gmail_quote">2013/1/30 Karaoui mohamed lamine <span dir="ltr"><<a href="mailto:moharaka@gmail.com" target="_blank">moharaka@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
thanks, i think i get it.<br><br><div class="gmail_quote">2013/1/30 <span dir="ltr"><<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>></span><div><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Tue, 29 Jan 2013 20:16:26 +0100, you said:<br>
<br>
> Actually my question is :<br>
> Does POSIX specifies the fact that we need to use "lockf" to be able to do<br>
> read/write operation in different offset ? Is'n the kernel supposed to<br>
> ensure this ?<br>
<br>
</div>If you have non-overlapping writes, the kernel will eventually sort it out<br>
for you. If your writes overlap, you'll have to provide your own locking<br>
via lockf() or similar, and synchronization via other methods.<br>
</blockquote></div></div></div><br>
</blockquote></div><br>
<br></div></div><div class="im">_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</font></span></div>
</blockquote></div><br>