func do_bench_loop(tid int, msg string, niter int, nsmtpiter int, npopiter int) error {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	for l := 0; l < niter; l++ {
		for i := 0; i < nsmtpiter; i++ {
			u := uint64(r.Int()) % mailboat.NumUsers
			mailboat.Deliver(u, []byte(msg))
		}
		for i := 0; i < npopiter; i++ {
			u := uint64(r.Int()) % mailboat.NumUsers
			msgs := mailboat.Pickup(u)
			for _, m := range msgs {
				mailboat.Delete(u, m.Id)
			}
			mailboat.Unlock(u)
		}
	}
	return nil
}
// Pick up is different from gomail, which only retrieves msgids
Pick up is different from gomail, which only retrieves msgids
// Pick up is different from gomail which only retrieves msgids
func do_bench_loop(tid int, msg string, niter int, nsmtpiter int, npopiter int) error {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	for l := 0; l < niter; l++ {
		for i := 0; i < nsmtpiter; i++ {
			u := uint64(r.Int()) % mailboat.NumUsers
			mailboat.Deliver(u, []byte(msg))
		}
		for i := 0; i < npopiter; i++ {
			u := uint64(r.Int()) % mailboat.NumUsers
			msgs := mailboat.Pickup(u)
			for _, m := range msgs {
				mailboat.Delete(u, m.Id)
			}
			mailboat.Unlock(u)
		}
	}
	return nil
}
func do_bench_loop ( tid int , msg string , niter int , nsmtpiter int , npopiter int ) error { r := rand . New ( rand . NewSource ( time . Now ( ) . UnixNano ( ) ) ) for l := 0 ; l < niter ; l ++ { for i := 0 ; i < nsmtpiter ; i ++ { u := uint64 ( r . Int ( ) ) % mailboat . NumUsers mailboat . Deliver ( u , [ ] byte ( msg ) ) } for i := 0 ; i < npopiter ; i ++ { u := uint64 ( r . Int ( ) ) % mailboat . NumUsers msgs := mailboat . Pickup ( u ) for _ , m := range msgs { mailboat . Delete ( u , m . Id ) } mailboat . Unlock ( u ) } } return nil }
Pick up is different from gomail, which only retrieves msgids
Pick up is different from gomail which only retrieves msgids