1753437 Members
5014 Online
108794 Solutions
New Discussion юеВ

Re: mkfifo

 
SOLVED
Go to solution
ji_1
Occasional Contributor

mkfifo

hi all ,
i have an oracle database 10g and i want user not to block the table while doing update or insert and even with select using wildcards which takes a lot of time and others will wait till they finish.

i thought of a FIFO file , that i can create under Linux , where i can put all the transactions there and i will not lock the users from work ..
this fifo file , will have IN and OUT pointers , one is used to read and the other to write .

the transactions will be executed one by one and i will not have lock or freeze system .


can i achieve that with mkfifo in Linux ? how to write in a fifo file and later read from it and put in the database?
am i using the right commands and is it true what i thought doing ?
FIFO queues are stored in memory or on disk ?
if my server will reboot , the infos will be lost from the fifo file ?

tx for ur replies.
Regards
2 REPLIES 2
Craig Gilmore
Trusted Contributor
Solution

Re: mkfifo

A FIFO file, or "named pipe" can accomplish what you are attempting. However, it is a special file, a socket, and resides in memory. There is no stable storage, per-se. The file structure is used for IPC. If your system reboots, any data in the queue will be lost.

There must be a reading process and a writing process. FIFO's are sort-of half duplex. The first process writes to a FIFO and a second process reads from that FIFO. You normally do not write to and read from the same pipe. Instead, if you want 2-way communication between processes, you write to a first FIFO and read from a second FIFO.

Take a look at the fifo(4) man page.

It is possible to use non-blocking with a FIFO, but both the server and the client applications will need to keep watch on the communication path. Usually, only the reading server uses non-blocking.

The warning from the fifo(4) man page says it best:

Under Linux, opening a FIFO for read and write will succeed both in blocking and non-blocking mode. POSIX leaves this behaviour undefined. This can be used to open a FIFO for writing while there are no readers available. A process that uses both ends of the connection in order to communicate with itself should be very careful to avoid deadlocks.

Good Luck!



ji_1
Occasional Contributor

Re: mkfifo

hi,

i prefer to use something that exists on the disk , cause maybe my server will doa reboot so my transactions will be lost if in memory.

do u have any other suggestion how to resolve my issue , someone told me about circular file ?

Tx for ur replies