展开菜单
首页 精品内容 本月促销 装机必备 Windows PDF教程 macOS软件 IOS软件 Android AI 专题
全部分类

当前位置:

首页 > 编程开发 > 怎么使用Java多线程Future获取异步任务

怎么使用Java多线程Future获取异步任务

Runnable的局限性在前文中我们谈到,通过编码实现Runnable接口,将获得具有边界性的"任务",在指定的线程(或者线程池)中运行。重新观察该接口,不难发现它并没有方法返回值:publicinterfaceRunnable{voidrun();}在JDK1.5之前,想利用任务的执行结果,需要小心的操作线程访问临界区资源。使用回调进行解耦是非常不错的选择。练手小Demo--回顾既往文章知识注意,为了减少篇幅使用了lambda,但jdk1.5之前并不支持lambda将计算任务分离到其他线程执行,再回到主

本文目录

    Runnable的局限性

    在前文中我们谈到,通过编码实现Runnable接口,将获得具有边界性的 "任务",在指定的线程(或者线程池)中运行。

    重新观察该接口,不难发现它并没有方法返回值:

    public interface Runnable {
        void run();
    }

    在JDK1.5之前,想利用任务的执行结果,需要小心的操作线程访问临界区资源。使用 回调 进行解耦是非常不错的选择。

    练手小Demo -- 回顾既往文章知识

    注意,为了减少篇幅使用了lambda,但jdk1.5之前并不支持lambda

    将计算任务分离到其他线程执行,再回到主线程消费结果

    我们将计算、IO等耗时任务丢到其他线程,让主线程专注于自身业务,假想它在接受用户输入以及处理反馈,但我们略去这一部分

    我们可以设计出类似下面的代码:

    虽然它还有很多不合理之处值得优化,但也足以用于演示

    class Demo {
        static final Object queueLock = new Object();
        static List mainQueue = new ArrayList<>();
        static boolean running = true;
        static final Runnable FINISH = () -> running = false;
        public static void main(String[] args) {
            synchronized (queueLock) {
                mainQueue.add(Demo::onStart);
            }
            while (running) {
                Runnable runnable = null;
                synchronized (queueLock) {
                    if (!mainQueue.isEmpty())
                        runnable = mainQueue.remove(0);
                }
                if (runnable != null) {
                    runnable.run();
                }
                Thread.yield();
            }
        }
        public static void onStart() {
            //...
        }
        public static void finish() {
            synchronized (queueLock) {
                mainQueue.clear();
                mainQueue.add(FINISH);
            }
        }
    }

    再模拟一个计算的线程和任务回调:

    interface Callback {
        void onResultCalculated(int result);
    }
    class CalcThread extends Thread {
        private final Callback callback;
        private final int a;
        private final int b;
        public CalcThread(Callback callback, int a, int b) {
            this.callback = callback;
            this.a = a;
            this.b = b;
        }
        @Override
        public void run() {
            super.run();
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            final int result = a + b;
            System.out.println("threadId" + Thread.currentThread().getId() + ",calc result:" + result + ";" + System.currentTimeMillis());
            synchronized (queueLock) {
                mainQueue.add(() -> callback.onResultCalculated(result));
            }
        }
    }

    填充一下onStart业务:

    class Demo {
        public static void onStart() {
            System.out.println("threadId" + Thread.currentThread().getId() + ",onStart," + System.currentTimeMillis());
            new CalcThread(result -> {
                System.out.println("threadId" + Thread.currentThread().getId() + ",onResultCalculated:" + result + ";" + System.currentTimeMillis());
                finish();
            }, 200, 300).start();
        }
    }

    复习:优化为使用Runnable

    在前文我们提到,如果业务仅关注任务的执行,并不过于关心线程本身,则可以利用Runnable:

    class Demo {
        static class CalcRunnable implements Runnable {
            private final Callback callback;
            private final int a;
            private final int b;
            public CalcRunnable(Callback callback, int a, int b) {
                this.callback = callback;
                this.a = a;
                this.b = b;
            }
            @Override
            public void run() {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                final int result = a + b;
                System.out.println("threadId" + Thread.currentThread().getId() + ",calc result:" + result + ";" + System.currentTimeMillis());
                synchronized (queueLock) {
                    mainQueue.add(() -> callback.onResultCalculated(result));
                }
            }
        }
        public static void onStart() {
            System.out.println("threadId" + Thread.currentThread().getId() + ",onStart," + System.currentTimeMillis());
            new Thread(new CalcRunnable(result -> {
                System.out.println("threadId" + Thread.currentThread().getId() + ",onResultCalculated:" + result + ";" + System.currentTimeMillis());
                finish();
            }, 200, 300)).start();
        }
    }

    不难想象出:我们非常需要

    • 让特定线程、特定类型的线程方便地接收任务,回顾本系列文章中的 线程池篇 ,线程池是应运而生

    • 拥有比Synchronize更轻量的机制

    • 拥有更方便的数据结构

    至此,我们可以体会到:JDK1.5之前,因为JDK的功能不足,Java程序对于线程的使用 较为粗糙。

    为异步而生的Future

    终于在JDK1.5中,迎来了新特性: Future 以及先前文章中提到的线程池, 时光荏苒,一晃将近20年了。

    /**
     * 略
     * @since 1.5
     * @author Doug Lea
     * @param  The result type returned by this Future's {@code get} method
     */
    public interface Future {
        boolean cancel(boolean mayInterruptIfRunning);
        boolean isCancelled();
        boolean isDone();
        V get() throws InterruptedException, ExecutionException;
        V get(long timeout, TimeUnit unit)
                throws InterruptedException, ExecutionException, TimeoutException;
    }

    尽管已经移除了API注释,但仍然能够理解每个API的含义,不多做赘述。

    显而易见,为了增加返回值,没有必要用如此复杂的 接口来替代 Runnable。简单思考后可以对返回值的情况进行归纳:

    • 返回Runnable中业务的结果,例如计算、读取资源等

    • 单纯的在Runnable执行完毕后返回一个结果

    从业务层上看,仅需要如下接口即可,它增加了返回值、并可以更友好地让使用者处理异常:

    作者按:抛开底层实现,仅看业务方编码需要

    public interface Callable {
        /**
         * Computes a result, or throws an exception if unable to do so.
         *
         * @return computed result
         * @throws Exception if unable to compute a result
         */
        V call() throws Exception;
    }

    显然,JDK需要提供后向兼容能力:

    • Runnable 不能够丢弃,也不应当丢弃

    • 不能要求使用者完全的重构代码

    所以一并提供了适配器,让使用者进行简单的局部重构即可用上新特性

    static final class RunnableAdapter implements Callable {
        final Runnable task;
        final T result;
        RunnableAdapter(Runnable task, T result) {
            this.task = task;
            this.result = result;
        }
        public T call() {
            task.run();
            return result;
        }
    }

    而Future恰如其名,它代表了在 "未来" 的一个结果和状态,为了更方便地处理异步而生。

    并且内置了 FutureTask,在 FutureTask详解 章节中再行展开。

    类图

    在JDK1.8的基础上,看一下精简的类图结构:

    怎么使用Java多线程Future获取异步任务

    FutureTask详解

    构造函数

    public class FutureTask {
        public FutureTask(Callable callable) {
            if (callable == null)
                throw new NullPointerException();
            this.callable = callable;
            this.state = NEW;       // ensure visibility of callable
        }
        public FutureTask(Runnable runnable, V result) {
            this.callable = Executors.callable(runnable, result);
            this.state = NEW;       // ensure visibility of callable
        }
    }

    生命周期

    public class FutureTask {
        //新建
        private static final int NEW = 0;
        //处理中
        private static final int COMPLETING = 1;
        //正常
        private static final int NORMAL = 2;
        //异常
        private static final int EXCEPTIONAL = 3;
        //已取消
        private static final int CANCELLED = 4;
        //中断中
        private static final int INTERRUPTING = 5;
        //已中断
        private static final int INTERRUPTED = 6;
    }

    可能的生命周期转换如下:

    • NEW -> COMPLETING -> NORMAL

    • NEW -> COMPLETING -> EXCEPTIONAL

    • NEW -> CANCELLED

    • NEW -> INTERRUPTING -> INTERRUPTED

    JDK中原汁原味的解释如下:

    The run state of this task, initially NEW. The run state transitions to a terminal state only in methods set, setException, and cancel. During completion, state may take on transient values of COMPLETING (while outcome is being set) or INTERRUPTING (only while interrupting the runner to satisfy a cancel(true)). Transitions from these intermediate to final states use cheaper ordered/lazy writes because values are unique and cannot be further modified.

    核心方法

    本节从以下三块入手阅读源码

    • 状态判断

    • 取消

    • 获取结果

    状态判断API的实现非常简单

    public class FutureTask {
        public boolean isCancelled() {
            return state >= CANCELLED;
        }
        public boolean isDone() {
            return state != NEW;
        }
    }

    取消:

    • 当前状态为 NEW 且 CAS修改 state 成功,否则返回取消失败

    • 如果 mayInterruptIfRunning 则中断在执行的线程并CAS修改state为INTERRUPTED

    • 调用 finishCompletion

      删除并通知所有等待的线程

      调用done()

      设置callable为null

    public class FutureTask {
        public boolean cancel(boolean mayInterruptIfRunning) {
            if (!(state == NEW &&
                    UNSAFE.compareAndSwapInt(this, stateOffset, NEW,
                            mayInterruptIfRunning ? INTERRUPTING : CANCELLED))) {
                return false;
            }
            try {    // in case call to interrupt throws exception
                if (mayInterruptIfRunning) {
                    try {
                        Thread t = runner;
                        if (t != null)
                            t.interrupt();
                    } finally { // final state
                        UNSAFE.putOrderedInt(this, stateOffset, INTERRUPTED);
                    }
                }
            } finally {
                finishCompletion();
            }
            return true;
        }
        private void finishCompletion() {
            // assert state > COMPLETING;
            for (WaitNode q; (q = waiters) != null; ) {
                if (UNSAFE.compareAndSwapObject(this, waitersOffset, q, null)) {
                    for (; ; ) {
                        Thread t = q.thread;
                        if (t != null) {
                            q.thread = null;
                            LockSupport.unpark(t);
                        }
                        WaitNode next = q.next;
                        if (next == null)
                            break;
                        q.next = null; // unlink to help gc
                        q = next;
                    }
                    break;
                }
            }
            done();
            callable = null;        // to reduce footprint
        }
    }

    获取结果: 先判断状态,如果未进入到 COMPLETING(即为NEW状态),则阻塞等待状态改变,返回结果或抛出异常

    public class FutureTask {
        public V get() throws InterruptedException, ExecutionException {
            int s = state;
            if (s <= COMPLETING)
                s = awaitDone(false, 0L);
            return report(s);
        }
        public V get(long timeout, TimeUnit unit)
                throws InterruptedException, ExecutionException, TimeoutException {
            if (unit == null)
                throw new NullPointerException();
            int s = state;
            if (s <= COMPLETING &&
                    (s = awaitDone(true, unit.toNanos(timeout))) <= COMPLETING)
                throw new TimeoutException();
            return report(s);
        }
        private V report(int s) throws ExecutionException {
            Object x = outcome;
            if (s == NORMAL)
                return (V) x;
            if (s >= CANCELLED)
                throw new CancellationException();
            throw new ExecutionException((Throwable) x);
        }
    }

    如何使用

    而使用则非常简单,也非常的朴素。

    我们以文中的的例子进行改造:

    • 沿用原Runnable逻辑

    • 移除回调,增加 CalcResult

    • 将 CalcResult 对象作为既定返回结果,Runnable中设置其属性

    class Demo {
       static class CalcResult {
          public int result;
       }
       public static void onStart() {
          System.out.println("threadId" + Thread.currentThread().getId() + ",onStart," + System.currentTimeMillis());
          final CalcResult calcResult = new CalcResult();
          Future<CalcResult> resultFuture = Executors.newSingleThreadExecutor().submit(() -> {
             try {
                Thread.sleep(10);
             } catch (InterruptedException e) {
                e.printStackTrace();
             }
             final int result = 200 + 300;
             System.out.println("threadId" + Thread.currentThread().getId() + ",calc result:" + result + ";" + System.currentTimeMillis());
             calcResult.result = result;
          }, calcResult);
          System.out.println("threadId" + Thread.currentThread().getId() + "反正干点什么," + System.currentTimeMillis());
          if (resultFuture.isDone()) {
             try {
                final int ret = resultFuture.get().result;
                System.out.println("threadId" + Thread.currentThread().getId() + ",get result:" + ret + ";" + System.currentTimeMillis());
             } catch (InterruptedException | ExecutionException e) {
                e.printStackTrace();
             }
          }
          finish();
       }
    }

    如果直接使用新特性Callback,则如下:

    直接返回结果,当然也可以直接返回Integer,不再包裹一层

    class Demo {
       public static void onStart() {
          System.out.println("threadId" + Thread.currentThread().getId() + ",onStart," + System.currentTimeMillis());
          ExecutorService executor = Executors.newSingleThreadExecutor();
          Future resultFuture = executor.submit(() -> {
             try {
                Thread.sleep(10);
             } catch (InterruptedException e) {
                e.printStackTrace();
             }
             final int result = 200 + 300;
             System.out.println("threadId" + Thread.currentThread().getId() + ",calc result:" + result + ";" + System.currentTimeMillis());
             final CalcResult calcResult = new CalcResult();
             calcResult.result = result;
             return calcResult;
          });
          System.out.println("threadId" + Thread.currentThread().getId() + "反正干点什么," + System.currentTimeMillis());
          if (resultFuture.isDone()) {
             try {
                final int ret = resultFuture.get().result;
                System.out.println("threadId" + Thread.currentThread().getId() + ",get result:" + ret + ";" + System.currentTimeMillis());
             } catch (InterruptedException | ExecutionException e) {
                e.printStackTrace();
             }
          }
          executor.shutdown();
          finish();
       }
    }

    相信读者诸君会有这样的疑惑:

    为何使用Future比原先的回调看起来粗糙?

    首先要明确一点:文中前段的回调Demo,虽然达成了既定目标,但效率并不高!!在当时计算很昂贵的背景下,并不会如此莽撞地使用!

    而在JDK1.5开始,提供了大量内容支持多线程开发。考虑到篇幅,会在系列文章中逐步展开。

    另外,FutureTask中的CAS与Happens-Before本篇中亦不做展开。

    接下来,再做一些引申,简单看一看多线程业务模式。

    引申,多线程业务模式

    常用的多线程设计模式包括:

    • Future模式

    • Master-Worker模式

    • Guarded Suspension模式

    • 不变模式

    • 生产者-消费

    Future模式

    文中对于Future的使用方式遵循了Future模式。

    业务方在使用时,已经明确了任务被分离到其他线程执行时有等待期,在此期间,可以干点别的事情,不必浪费系统资源。

    Master-Worker模式

    在程序系统中设计两类线程,并相互协作:

    • Master线程(单个)

    • Worker线程

    Master线程负责接受任务、分配任务、接收(必要时进一步组合)结果并返回;

    Worker线程负责处理子任务,当子任务处理完成后,向Master线程返回结果;

    作者按:此时可再次回想一下文章开头的Demo

    Guarded Suspension模式

    • 使用缓存队列,使得 服务线程/服务进程 在未就绪、忙碌时能够延迟处理请求。

    • 使用等待-通知机制,将消费 服务的返回结果 的方式规范化

    不变模式

    在并行开发过程中,为确保数据的一致性和正确性,有必要对对象进行同步,而同步操作会对程序系统的性能产生相当的损耗。

    因此,使用状态不可改变的对象,依靠其不变性来确保 并行操作 在 没有同步机制 的情况下,保持一致性和正确性。

    • 对象创建后,其内部状态和数据不再发生改变

    • 对象被共享、被多个线程访问

    生产者-消费

    设计两类线程:若干个生产者线程和若干个消费者线程。

    生产者线程负责提交用户请求,消费者线程负责处理用户请求。生产者和消费者之间通过共享内存缓冲区进行通信。

    内存缓冲区的意义:

    • 解决是数据在多线程间的共享问题

    • 缓解生产者和消费者之间的性能差

    这几种模式从不同角度出发解决特定问题,但亦有一定的相似之处,不再展开。

    本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系bd@zhengruan.com
    作者最新文章
    编程开发 Java
    相关文章 更多
    精品专题 更多
    装机必备

    正软商城装机必备专区,精选办公、浏览器、安全防护、影音播放、压缩解压、设计创作和系统工具等电脑常用正版软件,帮助用户快速完成新电脑软件配置。

    Windows

    正软商城Windows软件专区,汇集适用于Windows电脑的办公、设计、安全防护、影音播放、开发工具和系统优化软件,提供软件介绍、系统要求、正版授权及购买下载服务。

    PDF教程

    正软商城PDF教程频道提供PDF编辑、转换、合并、拆分、压缩及格式处理方法,同时介绍常用PDF软件和工具的使用技巧。

    macOS软件

    正软商城macOS软件专区,精选适用于Mac电脑的办公、设计、影音、效率、开发和系统工具,提供软件功能介绍、macOS兼容版本、正版授权及购买下载服务。

    IOS软件

    正软商城iOS软件专区,精选适用于iPhone和iPad的办公、学习、影音、设计、效率及AI应用,提供功能介绍、适用设备、系统要求和正版获取方式等信息。

    AI

    正软商城AI软件专区,汇集AI写作、AI绘画、AI视频、AI办公、AI编程、AI翻译、智能客服和数据分析等人工智能工具,提供功能介绍、适用平台、收费方式及正版购买信息。

    Mac软件 更多
    Postman macOS版
    Postman macOS版

    Postman是一套面向API全生命周期的开发与测试平台,可在Mac上发送和调试多种协议请求,管理集合、环境及认证信息,并完成脚本测试、模拟服务、监控、文档发布和团队协作。它适合开发、测试及运维人员使用,提供个人免费方案。

    Docker Desktop macOS版
    Docker Desktop macOS版

    Docker Desktop 是 Docker 官方为 Mac 提供的容器开发环境,集成 Docker Engine、命令行工具、Compose、Build、Kubernetes 与图形化管理界面。

    Android Studio macOS版
    Android Studio macOS版

    Android Studio 是 Google 面向安卓应用开发提供的官方集成开发环境,基于 IntelliJ IDEA 构建。它整合智能代码编辑、Gradle 构建、界面预览、设备模拟、性能分析、调试测试及 APK 分析等工具。

    Xcode macOS版
    Xcode macOS版

    Xcode 是苹果面向 Mac 提供的官方集成开发环境,将代码编辑、项目构建、SwiftUI 实时预览、设备模拟、自动化测试、断点调试、性能分析和应用分发整合在同一套工作流中,适合开发与维护 iPhone、iPad、Mac、Apple Wa

    JetBrains WebStorm macOS版
    JetBrains WebStorm macOS版

    JetBrains WebStorm 是面向 JavaScript、TypeScript 和现代 Web 技术的专业集成开发环境,可智能理解项目结构,提供代码补全、重构、错误检查、运行调试、测试及 Git 工具。

    PhpStorm macOS版
    PhpStorm macOS版

    PhpStorm 是 JetBrains 推出的专业 PHP 集成开发环境,可在 Mac 上完成代码编写、智能检查、重构、调试、测试和数据库管理。它支持主流 PHP 框架、Composer、Git、Docker 与远程解释器。

    JetBrains PyCharm macOS版
    JetBrains PyCharm macOS版

    JetBrains PyCharm 是面向 Python 开发者的集成开发环境,提供智能补全、代码检查、重构、调试、测试、版本控制及虚拟环境管理功能。Mac 版兼容 Intel 与 Apple 芯片,核心功能可免费使用。

    JetBrains IntelliJ IDEA macOS版
    JetBrains IntelliJ IDEA macOS版

    IntelliJ IDEA 是 JetBrains 推出的专业集成开发环境,重点服务于 Java、Kotlin 与 JVM 项目开发。软件集成代码补全、静态检查、重构、调试、测试、版本控制及构建工具,并可借助插件扩展语言和框架支持。

    Visual Studio Code macOS版
    Visual Studio Code macOS版

    Visual Studio Code 是微软提供的免费代码编辑器,支持 macOS,并为 Intel 与 Apple 芯片 Mac 提供适配版本。软件集代码编辑、调试、Git 源代码管理、集成终端和扩展市场于一体。

    REAPER macOS版
    REAPER macOS版

    REAPER是Cockos开发的数字音频工作站,提供多轨音频与MIDI录制、剪辑、处理、混音和母带制作工具。Mac版兼容Intel与Apple芯片,支持AU、VST、VST3、CLAP等插件格式,并提供高度可定制的工作流程。

    Adobe Audition macOS版
    Adobe Audition macOS版

    Adobe Audition 是面向播客、影视后期、音乐制作及内容创作者的专业音频工作站,提供波形精修、多轨录制与混音、频谱编辑、降噪修复、响度匹配和效果处理工具,并可与 Adobe Premiere 协同完成视频声音制作。

    Pro Tools macOS版
    Pro Tools macOS版

    Pro Tools 是 Avid 推出的专业数字音频工作站,覆盖多轨录音、无损剪辑、MIDI 编曲、插件处理、自动化混音及声音与画面同步等工作。它拥有 Intro、Artist、Studio 和 Ultimate 等方案。

    WINDOWS 更多
    Postman Windows版
    Postman Windows版

    Postman 是面向 API 全生命周期的开发与协作平台。Windows 桌面版可用于构建和发送 HTTP、GraphQL、gRPC、WebSocket、MQTT 等请求,并提供环境变量、集合、脚本测试、模拟服务、监控、文档及团队工作区等

    Docker Desktop Windows版
    Docker Desktop Windows版

    Docker Desktop 为 Windows 开发者提供集成式容器环境,内置 Docker Engine、命令行工具、Compose、Build 与 Kubernetes 等组件,可在本机完成镜像构建、容器运行、日志查看和资源管理。

    Android Studio Windows版
    Android Studio Windows版

    Android Studio 是 Google 面向 Android 应用开发提供的官方集成开发环境,以 IntelliJ IDEA 为基础,集成智能代码编辑、Gradle 构建、设备模拟、界面预览、调试测试及性能分析工具,

    JetBrains WebStorm Windows版
    JetBrains WebStorm Windows版

    WebStorm 是 JetBrains 面向 JavaScript、TypeScript 和现代 Web 技术打造的集成开发环境。它提供项目级代码分析、智能补全、安全重构、导航搜索,并集成调试、测试、终端、Git 与常用前端工具,

    JetBrains PhpStorm Windows版
    JetBrains PhpStorm Windows版

    PhpStorm 是 JetBrains 面向 PHP 与现代 Web 开发打造的专业集成开发环境,提供代码补全、静态检查、重构、调试、测试、数据库、版本控制及前端语言支持。Windows 用户可直接下载安装程序,

    JetBrains PyCharm Windows版
    JetBrains PyCharm Windows版

    PyCharm 是 JetBrains 推出的 Python 集成开发环境,提供智能代码补全、错误检查、重构、调试、测试、Git、终端及 Jupyter Notebook 支持。统一版安装后可体验 30 天 Pro 功能,

    JetBrains IntelliJ IDEA Windows版
    JetBrains IntelliJ IDEA Windows版

    JetBrains IntelliJ IDEA 是以 Java、Kotlin 和 JVM 项目为核心的专业集成开发环境,提供智能补全、代码检查、安全重构、调试、测试、版本控制及构建工具集成。统一发行版的核心功能可免费用于商业和非商业项目,

    Visual Studio Code Windows版
    Visual Studio Code Windows版

    Visual Studio Code 是微软推出的免费代码编辑器,Windows 版集成智能补全、代码导航、调试、终端和版本控制,并可通过扩展添加语言、格式化及远程开发能力。它启动较快、配置灵活,

    REAPER Windows版
    REAPER Windows版

    REAPER 是 Cockos 推出的数字音频工作站,适用于录音、MIDI 编曲、音频编辑、混音、母带制作及声音设计。软件安装包小巧,支持多轨录制、灵活路由、自动化、第三方插件和脚本扩展,并提供完整功能的 60 天免费评估期。

    Adobe Audition Windows版
    Adobe Audition Windows版

    Adobe Audition 是面向播客、影视后期、广播与音乐制作的专业音频工作站,提供波形编辑、多轨混音、频谱分析、录音、降噪修复和效果处理等功能。Windows 版通过 Adobe Creative Cloud 安装和管理,

    Pro Tools Windows版
    Pro Tools Windows版

    Pro Tools 是 Avid 推出的专业数字音频工作站,提供多轨录音、音频剪辑、MIDI编曲、插件处理、自动化混音及影视声音制作能力。它适合音乐人、录音师、制作人和音频后期团队使用,并提供免费入门版、订阅方案及永久授权选择。

    Cubase Windows版
    Cubase Windows版

    Cubase 是 Steinberg 推出的数字音频工作站,提供 MIDI 编曲、多轨录音、音频编辑、虚拟乐器、效果处理、自动化、混音和母带输出工具。其 Pro、Artist 与 Elements 版本面向不同预算和制作规模,