Author: Manlio Perillo manlio.perillo@gmail.com
Last updated: 26 Novemberr 2015
Discussion at https://golang.org/issue/XXXXX.
/* | |
* Create an input/output character device that will put in an | |
* uninterruptible sleep state the user process that opens it. | |
* | |
* Copyright 2014 Manlio Perillo. All rights reserved. | |
*/ | |
#include <linux/kernel.h> | |
#include <linux/module.h> | |
#include <linux/moduleparam.h> |
// Read each line from a reader, and report the number of lines until EOF, | |
// as a negative integer, for the last N lines. | |
// | |
// Copyright Manlio Perillo (manlio.perillo@gmail.com) | |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" |
// Check generate assembler with | |
// go tool 6g -S src/string-ref.go | |
package main | |
import ( | |
"fmt" | |
"unsafe" | |
) | |
func do(b []byte) { |
#!/usr/bin/env python3 | |
import threading | |
import time | |
def syncc(f, *args, **kwargs): | |
"""syncc calls the asynchronous function f with supplied | |
parameters, waiting until the function callback is called, and returning | |
the received parameters. | |
""" |
// https://gist.github.com/perillo/4bda8e2f57bc3bd16dbc | |
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
) |
// Copyright 2015 Manlio Perillo. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Package atexit implements support for running deferred functions in case of | |
// abnormal exit (in contrast to a normal exit when the program returns from | |
// the main function). | |
// | |
// Since calling os.Exit, e.g. during a signal handler, does not call deferred | |
// functions, a complementary mechanism is required when the program acquires |
package errors | |
import ( | |
"errors" | |
"fmt" | |
"runtime" | |
) | |
type errorDebug struct { | |
error |
Author: Manlio Perillo manlio.perillo@gmail.com
Last updated: 26 Novemberr 2015
Discussion at https://golang.org/issue/XXXXX.
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func producer(ch chan<- int) { | |
ch <- 0 | |
} |
package main | |
import ( | |
"fmt" | |
"time" | |
"unsafe" | |
) | |
func producer(ch chan<- int) { | |
ch <- 777 |