转到线程-暂停执行

I have two threads of execution like,

Routine 1 {
// do something
}
Routine 2 {
// do something
}

Is it possible to pause execution of routine 2 from routine 1 for few seconds and how can it possible ?

From one thread, it is not possible to control another thread implicitly. You can do like this, define a bool and based on that you can pause by time.Sleep(2*1e9).

It is not possible to control the execution of one goroutine from another. Goroutines are cooperative. They don't dominate each other.

What you could do is put points in routine 2 where it checks whether it's allowed to proceed. Such as

// do stuff
select {
case <-wait:
    <-resume
default:
}

Then routine 1 could tell routine 1 could send a signal to routine 2 telling it to wait:

wait <- true
// whatever stuff goes here
resume <- true

Why do you want to pause the goroutine? That might help answer your question better. It is best to start from a place of what you are trying to do rather than how you want to do it. That way, you can find out how to achieve what you actually want in the language, rather than being given poor substitutes for the method of achieving it that you'd originally imagined.