Re: "Non-blocking write" following a successful poll, may get -EAGAIN ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



anon... anon.al wrote:
Hello!

Assume a user-space application "A" calls poll to see if a write would block.
->The poll call then suceeds and the application "A" will now perform
a "nonblocking write".

Must this application's "nonblocking write" now succeed [-OR-] or is
it allowed, that the instance in "ssize_t device_read()" returns
-EAGAIN, so that the application must loop back and poll again.

I could fail if too much time elapses between the poll() and the actual write(). How much is too much probably depends on how fast the return status of poll() may change - eg. fast or slow device.


Consider what happens if the poll succeeds, but another application
"B" is faster and performs the write before "A"! -> Must this be
prevented according to Linux/Unix semantics, or is it the programmer's
choice if he/she wishes to implement that lock???

Programmer is responsible for the synchronization of the access to the same device.

HTH,
HInko


--
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar@xxxxxxxxxxxx
Http: www.cetrtapot.si


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux