Goroutines count and id

79 праглядаў
Перайсці да першага непрачытанага паведамлення

Durga Someswararao G

не прачытана,
30 чэр 2020 г., 03:35:4030.06.20
да golang-nuts
Hi,
Can some one help for below queries

Is it possible to get goroutine id when we creted?
Is it possible to get goroutines count while we creating?
Is it possible to terminate a goroutine based on ID like if any goroutine has infinite loops?
Is it possible to clean up memory of variable like we have free in C?

Thanks,
Durga SomeswaraRao G.

Jan Mercl

не прачытана,
30 чэр 2020 г., 03:50:3930.06.20
да Durga Someswararao G,golang-nuts
On Tue, Jun 30, 2020 at 9:36 AM Durga Someswararao G
<durgasomes...@gmail.com> wrote:

> Is it possible to get goroutine id when we creted?
> Is it possible to get goroutines count while we creating?
> Is it possible to terminate a goroutine based on ID like if any goroutine has infinite loops?
> Is it possible to clean up memory of variable like we have free in C?

The answer to all of the above questions, in the first approximation, is no.

Unsafe tricks may help to achieve some of those goals. What's the
purpose? Is this a XY problem?

Hugo Cornelis

не прачытана,
30 чэр 2020 г., 04:50:3230.06.20
да Jan Mercl,Durga Someswararao G,golang-nuts

If you want to identify goroutines at runtime, you can find in the attachments patches for Golang 1.10 to allow to assign a name to a goroutine.

These are patches against Golang 1.10 because I have been using the gccgo runtime that comes with GCC 8.4.

This could help you forward for what you want.

Hugo


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-ULnCkc7hw0c%3DQCTSAvyP3ZO4rXmTEjm5fb6m2QTJC%3Duw%40mail.gmail.com.
0002-improved-goroutine-name-reporting-wrt-parsing.patch
0001-added-goroutine-naming.patch
Адказаць усім
Адказаць аўтару
Наперад
0 новых паведамленняў