comp.lang.ada
 help / color / mirror / Atom feed
* Re: Opening a fifo hangs
  1999-02-18  0:00 Opening a fifo hangs John I Quist
@ 1999-02-18  0:00 ` robert_dewar
  1999-02-19  0:00   ` John I Quist
  0 siblings, 1 reply; 7+ messages in thread
From: robert_dewar @ 1999-02-18  0:00 UTC (permalink / raw)


In article <7agtmi$8a$1@nyheter.chalmers.se>,
  z93john@mtek.chalmers.se (John I Quist) wrote:
> Hi!
>
> I'm tring to establish communication between two
> processes on the same  Sun machine. (SunOS 5.6; running
> GNAT 3.05)

Is there any good reason to be using such an ancient (well
over two years old, and six versions back) version of GNAT?



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Opening a fifo hangs
@ 1999-02-18  0:00 John I Quist
  1999-02-18  0:00 ` robert_dewar
  0 siblings, 1 reply; 7+ messages in thread
From: John I Quist @ 1999-02-18  0:00 UTC (permalink / raw)


Hi!

I'm tring to establish communication between two processes on the same 
Sun machine. (SunOS 5.6; running GNAT 3.05)

I have created two named pipes, and if I open two terminals, I can do
the following, without a problem:

In /dev/pts/3 (e.g.)
cat > mypipe
typetypetype
^D

In /dev/pts/4
cat mypipe

As expected, the text typed into the pipe on "pts/3" arrives neatly
on "pts/4"... 

BUT, if I make a small Ada hack to open the pipes and read/write to them,
one program reads and the other writes, the program hangs.
The lines where execution halts are:

--- Write side ---
open(IN_F, IN_FILE, "/users/ztek/z93john/.comm_pipe");
------------------

--- Read side ---
open(OUT_F, OUT_FILE, "/users/ztek/z93john/.comm_pipe");
-----------------

(Both programs use TEXT_IO)


If I run "truss" to get the system calls, I find that both programs do
open("/users/ztek/z93john/.comm_pipe", O_RDONLY) (sleeping...)

BUT; if I kill the "writer" and do a 
cat > .comm_pipe [Return]
the "reader" opens the fifo!

Why doesn't the writer open the pipe? 
I have read the GNAT reference, and I didn't get much wiser...
- Is Ada doing something weird here, or is it me? 

(As I understand it, the programs are supposed to block until both 
ends of the pipe are open, but that's what I'm doing, isn't it?
Open for write on one end, read on the other...)


I would really appreciate an email copy of your replies.

Thank you!
/John.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Opening a fifo hangs
  1999-02-18  0:00 ` robert_dewar
@ 1999-02-19  0:00   ` John I Quist
  1999-02-19  0:00     ` robert_dewar
  0 siblings, 1 reply; 7+ messages in thread
From: John I Quist @ 1999-02-19  0:00 UTC (permalink / raw)


robert_dewar@my-dejanews.com wrote:
: > I'm tring to establish communication between two
: > processes on the same  Sun machine. (SunOS 5.6; running
: > GNAT 3.05)
: Is there any good reason to be using such an ancient (well
: over two years old, and six versions back) version of GNAT?

From MY perspective, no. From my university's perspective - 
it seems, yes. I can't do much more than complain, eh?

BTW - the communication is not the goal for the project I'm
doing, it's just a neat addition. I'm NOT trying to get the 
group to solve my homework... 
(Just trying to stop the flames before they start....)

/John.
--
 "I like them but when I hit them they scream and run away
  even though I say I'm sorry. I like meeting people."
                                         - The Sugarcubes





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Opening a fifo hangs
  1999-02-19  0:00   ` John I Quist
@ 1999-02-19  0:00     ` robert_dewar
  1999-02-22  0:00       ` John I Quist
  0 siblings, 1 reply; 7+ messages in thread
From: robert_dewar @ 1999-02-19  0:00 UTC (permalink / raw)


In article <7ajif8$8ee$1@nyheter.chalmers.se>,
  z93john@mtek.chalmers.se (John I Quist) wrote:
> robert_dewar@my-dejanews.com wrote:
> : Is there any good reason to be using such an ancient
> : (well over two years old, and six versions back)
> : version of GNAT?
>
> From MY perspective, no. From my university's perspective
> it seems, yes. I can't do much more than complain, eh?

Perhaps you can! You do not need to rely on your university
to install the software you need, and it
definitely appears that indeed you can't rely on them.

Grab your own copy of GNAT, on any machine you like, the
Solaris version if you like, and install it where you want
using option 3. Now of course if your university will not
supply the few $$ worth of disk space necessary for this
installation, then you do have a problem.
>
> BTW - the communication is not the goal for the project
I'm
> doing, it's just a neat addition. I'm NOT trying to get
the
> group to solve my homework...
> (Just trying to stop the flames before they start....)
>
> /John.
> --
>  "I like them but when I hit them they scream and run
away
>   even though I say I'm sorry. I like meeting people."
>                                          - The Sugarcubes
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Opening a fifo hangs
  1999-02-19  0:00     ` robert_dewar
@ 1999-02-22  0:00       ` John I Quist
  1999-02-22  0:00         ` dennison
  0 siblings, 1 reply; 7+ messages in thread
From: John I Quist @ 1999-02-22  0:00 UTC (permalink / raw)


robert_dewar@my-dejanews.com wrote:
: > : Is there any good reason to be using such an ancient
: > : (well over two years old, and six versions back)
: > : version of GNAT?
: >
: > From MY perspective, no. From my university's perspective
: > it seems, yes. I can't do much more than complain, eh?

: Grab your own copy of GNAT, on any machine you like, the
: Solaris version if you like, and install it where you want
: using option 3. Now of course if your university will not
: supply the few $$ worth of disk space necessary for this
: installation, then you do have a problem.

Disk space is indeed a problem... I have 19 megs left of my 
42 meg quota. I'll take a look at the GNAT package and see 
if it's possible to squeeze it in.

BTW: do you have any idea what's my problem with the fifo?






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Opening a fifo hangs
  1999-02-22  0:00       ` John I Quist
@ 1999-02-22  0:00         ` dennison
  1999-02-22  0:00           ` John I Quist
  0 siblings, 1 reply; 7+ messages in thread
From: dennison @ 1999-02-22  0:00 UTC (permalink / raw)


In article <7ardv0$slp$1@nyheter.chalmers.se>,
  z93john@mtek.chalmers.se (John I Quist) wrote:
> : using option 3. Now of course if your university will not
> : supply the few $$ worth of disk space necessary for this
> : installation, then you do have a problem.
>
> Disk space is indeed a problem... I have 19 megs left of my
> 42 meg quota. I'll take a look at the GNAT package and see
> if it's possible to squeeze it in.

Considering that the NT binary distribution was 18M compressed, I don't think
you're gonna make it. I'd suggest going to the powers that be and asking to
have your quota bumped by 20M or so. UCF would always do it for me when
asked.

T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Opening a fifo hangs
  1999-02-22  0:00         ` dennison
@ 1999-02-22  0:00           ` John I Quist
  0 siblings, 0 replies; 7+ messages in thread
From: John I Quist @ 1999-02-22  0:00 UTC (permalink / raw)


dennison@telepath.com wrote:
: > Disk space is indeed a problem... I have 19 megs left of my
: > 42 meg quota. I'll take a look at the GNAT package and see
: > if it's possible to squeeze it in.

: Considering that the NT binary distribution was 18M compressed, I don't think
: you're gonna make it. I'd suggest going to the powers that be and asking to
: have your quota bumped by 20M or so. UCF would always do it for me when

It didn't fit.. ;)
The powers that be are nice indeed, but they are fighting against the 
almighty bureaucracy(sp?) and haven't managed to shake loose the cash 
needed to buy more disk space.

I did a "pragma Import (C, Execute, "system");" instead.
I circumvent the open() problems by doing "echo string > fifo".
It isn't pretty, but what the... It works, and that's what matters today.
If somebody finds an answer, I'd be glad to see it!

Thanx for your help!

/John.






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-02-22  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-18  0:00 Opening a fifo hangs John I Quist
1999-02-18  0:00 ` robert_dewar
1999-02-19  0:00   ` John I Quist
1999-02-19  0:00     ` robert_dewar
1999-02-22  0:00       ` John I Quist
1999-02-22  0:00         ` dennison
1999-02-22  0:00           ` John I Quist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox