9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] nanosleep()?
@ 2011-10-28  4:07 Lucio De Re
  2011-10-28  4:12 ` ron minnich
  0 siblings, 1 reply; 15+ messages in thread
From: Lucio De Re @ 2011-10-28  4:07 UTC (permalink / raw)
  To: 9fans

In porting the prof command from the Go distribution (src/cmd/prof),
absence of the nanosleep() function seems to be the final stumbling
block, at least for compilation purposes.  Any suggestions on how to
implement it?

++L




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

* Re: [9fans] nanosleep()?
  2011-10-28  4:07 [9fans] nanosleep()? Lucio De Re
@ 2011-10-28  4:12 ` ron minnich
  2011-10-28  9:59   ` Anthony Martin
  0 siblings, 1 reply; 15+ messages in thread
From: ron minnich @ 2011-10-28  4:12 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

On Thu, Oct 27, 2011 at 9:07 PM, Lucio De Re <lucio@proxima.alt.za> wrote:
> In porting the prof command from the Go distribution (src/cmd/prof),
> absence of the nanosleep() function seems to be the final stumbling
> block, at least for compilation purposes.  Any suggestions on how to
> implement it?

well, it is unlikely to say the least that the OSes we have will let
you sleep for precisely one nanosecond. I'd be surprised if they even
hit a microsecond reliably ...

For a first pass, you could create a nanosleep for plan 9 that rounds
to milliseconds and then use sleep()

ron



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

* Re: [9fans] nanosleep()?
  2011-10-28  4:12 ` ron minnich
@ 2011-10-28  9:59   ` Anthony Martin
  2011-10-28 10:25     ` Charles Forsyth
  0 siblings, 1 reply; 15+ messages in thread
From: Anthony Martin @ 2011-10-28  9:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: lucio

ron minnich <rminnich@gmail.com> once said:
> For a first pass, you could create a nanosleep for plan 9
> that rounds to milliseconds and then use sleep()

Yup.  This is the right thing to do.  The prof command
in the Go distribution has a minimum sampling interval
of one millisecond so you don't even need nanosleep.

  Anthony



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

* Re: [9fans] nanosleep()?
  2011-10-28  9:59   ` Anthony Martin
@ 2011-10-28 10:25     ` Charles Forsyth
  2011-10-28 10:39       ` Charles Forsyth
  0 siblings, 1 reply; 15+ messages in thread
From: Charles Forsyth @ 2011-10-28 10:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>Implementing nanosleep() does not require enormous resolution,
>although there are complications.

well, yes. it requires that struct timespec crud as well.
the interaction with signals doesn't seem to be relevant.

at least it doesn't use ptrace directly!



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

* Re: [9fans] nanosleep()?
  2011-10-28 10:25     ` Charles Forsyth
@ 2011-10-28 10:39       ` Charles Forsyth
  2011-10-28 11:31         ` Lucio De Re
  0 siblings, 1 reply; 15+ messages in thread
From: Charles Forsyth @ 2011-10-28 10:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

after looking at the source, i'd say nanosleep is the least of your troubles.



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

* Re: [9fans] nanosleep()?
  2011-10-28 10:39       ` Charles Forsyth
@ 2011-10-28 11:31         ` Lucio De Re
  2011-10-28 11:42           ` Charles Forsyth
  0 siblings, 1 reply; 15+ messages in thread
From: Lucio De Re @ 2011-10-28 11:31 UTC (permalink / raw)
  To: 9fans

> after looking at the source, i'd say nanosleep is the least of your troubles.

You think that once it compiles, it will not work as required?  I have
not looked very deeply under the bonnet, so I must have missed
important details.

++L




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

* Re: [9fans] nanosleep()?
  2011-10-28 11:31         ` Lucio De Re
@ 2011-10-28 11:42           ` Charles Forsyth
  2011-10-28 12:05             ` Lucio De Re
  0 siblings, 1 reply; 15+ messages in thread
From: Charles Forsyth @ 2011-10-28 11:42 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

ppmaps might just work (depending on libmach, i suppose).
also, although it's supposed to profile at "regular" real-time intervals,
it seems to assume that regularity will just happen. perhaps it does.



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

* Re: [9fans] nanosleep()?
  2011-10-28 11:42           ` Charles Forsyth
@ 2011-10-28 12:05             ` Lucio De Re
  2011-10-28 12:08               ` Lucio De Re
  0 siblings, 1 reply; 15+ messages in thread
From: Lucio De Re @ 2011-10-28 12:05 UTC (permalink / raw)
  To: charles.forsyth, lucio, 9fans

> ppmaps might just work (depending on libmach, i suppose).
> also, although it's supposed to profile at "regular" real-time intervals,
> it seems to assume that regularity will just happen. perhaps it does.

I do wonder who assembled all these tools, I have found enough
mixtures of Plan 9 compatibilities and Posix-isms to cause me
indigestion.  But at this point I only want to eliminate compilation
errors in the Go build procedure under Plan 9, I don't really care if
some tools do not function as required, as long as they are not
essential to the build.

On the other hand, if the tools can be made to work correctly besides
compiling successfully, it will improve the likely acceptance of Go
and that ought to be a good thing.

++L




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

* Re: [9fans] nanosleep()?
  2011-10-28 12:05             ` Lucio De Re
@ 2011-10-28 12:08               ` Lucio De Re
  2011-10-28 12:20                 ` Charles Forsyth
  0 siblings, 1 reply; 15+ messages in thread
From: Lucio De Re @ 2011-10-28 12:08 UTC (permalink / raw)
  To: lucio, 9fans

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

Oops, a heavy handed comment intended to amuse Charles rather than be
critical of the Go Authors.  I do not intend to offend anyone and I
apologise if I did.

++L

[-- Attachment #2: Type: message/rfc822, Size: 1776 bytes --]

From: Lucio De Re <lucio@proxima.alt.za>
To: charles.forsyth@gmail.com, lucio@proxima.alt.za, 9fans@9fans.net
Subject: Re: [9fans] nanosleep()?
Date: Fri, 28 Oct 2011 14:05:25 +0200
Message-ID: <755c0af9d04658f3d757fd5e5f29dd92@proxima.alt.za>

> ppmaps might just work (depending on libmach, i suppose).
> also, although it's supposed to profile at "regular" real-time intervals,
> it seems to assume that regularity will just happen. perhaps it does.

I do wonder who assembled all these tools, I have found enough
mixtures of Plan 9 compatibilities and Posix-isms to cause me
indigestion.  But at this point I only want to eliminate compilation
errors in the Go build procedure under Plan 9, I don't really care if
some tools do not function as required, as long as they are not
essential to the build.

On the other hand, if the tools can be made to work correctly besides
compiling successfully, it will improve the likely acceptance of Go
and that ought to be a good thing.

++L

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

* Re: [9fans] nanosleep()?
  2011-10-28 12:08               ` Lucio De Re
@ 2011-10-28 12:20                 ` Charles Forsyth
  2011-10-28 14:32                   ` Lucio De Re
  0 siblings, 1 reply; 15+ messages in thread
From: Charles Forsyth @ 2011-10-28 12:20 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

well, in the particular case of profiling, i suspect you might find
that you can do
a better job by using or adapting some existing Plan 9 facilities for the same.

just take unsuitable things out of the mkfiles, since no other system
is using those.
On 28 October 2011 13:05, Lucio De Re <lucio@proxima.alt.za> wrote:>
On the other hand, if the tools can be made to work correctly besides>
compiling successfully, it will improve the likely acceptance of Go>
and that ought to be a good thing.



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

* Re: [9fans] nanosleep()?
  2011-10-28 12:20                 ` Charles Forsyth
@ 2011-10-28 14:32                   ` Lucio De Re
  2011-10-29 20:48                     ` Christopher Nielsen
  0 siblings, 1 reply; 15+ messages in thread
From: Lucio De Re @ 2011-10-28 14:32 UTC (permalink / raw)
  To: 9fans

> just take unsuitable things out of the mkfiles, since no other system
> is using those.

I was discussing with Ron the fact that in the longer term goinstall
ought to supersede both gmake (at last!) and mk, in building Go. I
guess it needs to deal with situations like the present one kind of a
priori.

++L




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

* Re: [9fans] nanosleep()?
  2011-10-28 14:32                   ` Lucio De Re
@ 2011-10-29 20:48                     ` Christopher Nielsen
  0 siblings, 0 replies; 15+ messages in thread
From: Christopher Nielsen @ 2011-10-29 20:48 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

Based on golang mailing list discussions, I do believe that the intent
is to have something like goinstall be the build tool for go, but I
could have misinterpreted what I read.

On Fri, Oct 28, 2011 at 07:32, Lucio De Re <lucio@proxima.alt.za> wrote:
>> just take unsuitable things out of the mkfiles, since no other system
>> is using those.
>
> I was discussing with Ron the fact that in the longer term goinstall
> ought to supersede both gmake (at last!) and mk, in building Go. I
> guess it needs to deal with situations like the present one kind of a
> priori.
>
> ++L
>
>
>



--
Christopher Nielsen
"They who can give up essential liberty for temporary safety, deserve
neither liberty nor safety." --Benjamin Franklin
"The tree of liberty must be refreshed from time to time with the
blood of patriots & tyrants." --Thomas Jefferson



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

* Re: [9fans] nanosleep()?
  2011-10-28  9:21 ` Charles Forsyth
@ 2011-10-28  9:44   ` Lucio De Re
  0 siblings, 0 replies; 15+ messages in thread
From: Lucio De Re @ 2011-10-28  9:44 UTC (permalink / raw)
  To: charles.forsyth, 9fans

> what do they do with nanosleep?

Don't know, really.

> perhaps they are simply implementing a profiling system themselves
> because the operating system might not provide a suitable one.

This is Go, so I'm sure they are looking for a uniform approach.  I
guess they looked too hard?

> perhaps plan 9 could provide a suitable one instead.
> perhaps it already does.

It seems that the model is Plan 9's prof, but I don't know this well
enough to be the judge.  Definitely, though, I'm reluctant to submit a
Plan 9 variant as contrary to the way I understand the Go Authors to
operate.

Implementing nanosleep() does not require enormous resolution,
although there are complications.

++L




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

* Re: [9fans] nanosleep()?
  2011-10-28  4:32 Lucio De Re
@ 2011-10-28  9:21 ` Charles Forsyth
  2011-10-28  9:44   ` Lucio De Re
  0 siblings, 1 reply; 15+ messages in thread
From: Charles Forsyth @ 2011-10-28  9:21 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

what do they do with nanosleep?
perhaps they are simply implementing a profiling system themselves
because the operating system might not provide a suitable one.
perhaps plan 9 could provide a suitable one instead.
perhaps it already does.



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

* Re: [9fans] nanosleep()?
@ 2011-10-28  4:32 Lucio De Re
  2011-10-28  9:21 ` Charles Forsyth
  0 siblings, 1 reply; 15+ messages in thread
From: Lucio De Re @ 2011-10-28  4:32 UTC (permalink / raw)
  To: 9fans

> For a first pass, you could create a nanosleep for plan 9 that rounds
> to milliseconds and then use sleep()

Sounds like a plan, because the man page for nanosleep() expects the
underlying resolution to be implemented.  The complexities of "does
not interact with signals" can probably be ignored until further
notice for present purposes.  Being able to resume may take a bit of
effort.

++L




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

end of thread, other threads:[~2011-10-29 20:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-28  4:07 [9fans] nanosleep()? Lucio De Re
2011-10-28  4:12 ` ron minnich
2011-10-28  9:59   ` Anthony Martin
2011-10-28 10:25     ` Charles Forsyth
2011-10-28 10:39       ` Charles Forsyth
2011-10-28 11:31         ` Lucio De Re
2011-10-28 11:42           ` Charles Forsyth
2011-10-28 12:05             ` Lucio De Re
2011-10-28 12:08               ` Lucio De Re
2011-10-28 12:20                 ` Charles Forsyth
2011-10-28 14:32                   ` Lucio De Re
2011-10-29 20:48                     ` Christopher Nielsen
2011-10-28  4:32 Lucio De Re
2011-10-28  9:21 ` Charles Forsyth
2011-10-28  9:44   ` Lucio De Re

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).